firefly-linux-kernel-4.4.55.git
9 years agostaging/rdma/hfi1: Wrong cast breaks desired pointer arithmetic
Mitko Haralanov [Mon, 26 Oct 2015 14:28:39 +0000 (10:28 -0400)]
staging/rdma/hfi1: Wrong cast breaks desired pointer arithmetic

The address being mapped into a process's memory for notification events was
improperly calculated due to cast that was happening too early. dd->events is a
pointer and should have been casted to unsigned long after the pointer
arithmetic was done, not before.

As a result, processes were looking at the wrong place and not seeing their
notification events.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Prevent silent data corruption with user SDMA
Mitko Haralanov [Mon, 26 Oct 2015 14:28:37 +0000 (10:28 -0400)]
staging/rdma/hfi1: Prevent silent data corruption with user SDMA

User SDMA keeps track of progress into the submitted IO vectors by tracking an
offset into the vectors when packets are submitted. This offset is updated
after a successful submission of a txreq to the SDMA engine.

The same offset was used when determining whether an IO vector should be
'freed' (pages unpinned) in the SDMA callback functions.

This was causing a silent data corruption in big jobs (> 2 nodes, 120 ranks
each) on the receive side because the send side was mistakenly unpinning the
vector pages before the HW has processed all descriptors referencing the
vector.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Fix port bounce issues with 0.22 DC firmware
Easwar Hariharan [Mon, 26 Oct 2015 14:28:36 +0000 (10:28 -0400)]
staging/rdma/hfi1: Fix port bounce issues with 0.22 DC firmware

The DC firmware overwrites the enable_lane_tx register and does not update it
on a host request to go to Poll. This causes an infinite loop through the LNI
state machine if a link width downgrade occurs. This patch re-sets the
enable_lane_tx register to all 4 lanes.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Add a schedule in send thread
Dean Luick [Mon, 26 Oct 2015 14:28:35 +0000 (10:28 -0400)]
staging/rdma/hfi1: Add a schedule in send thread

When under heavy load, the send handler can run too long without allowing other
tasks to run.  Add a conditional resched to break this up.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Reset firmware instead of reloading Sbus
Caz Yokoyama [Mon, 26 Oct 2015 14:28:34 +0000 (10:28 -0400)]
staging/rdma/hfi1: Reset firmware instead of reloading Sbus

Reset firmware instead of reloading Sbus firmware if it's already done for this
ASIC.  To work around thermal polling problem in firmware, don't reload Sbus
firmware, instead, reset the firmware on the initialization of the second HFI.

Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: close shared context security hole
Jareer Abdel-Qader [Mon, 26 Oct 2015 14:28:33 +0000 (10:28 -0400)]
staging/rdma/hfi1: close shared context security hole

Driver does not verify userid for shared context assignments, allowing
malicious user access.

Reviewed by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Jareer H Abdel-Qader <jareer.h.abdel-qader@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Add coalescing support for SDMA TX descriptors
Niranjana Vishwanathapura [Mon, 26 Oct 2015 14:28:32 +0000 (10:28 -0400)]
staging/rdma/hfi1: Add coalescing support for SDMA TX descriptors

This fixes transmit errors when the number of scatter gather elements in the
request is more that the number of per packet descriptors supported by the
hardware, allocate and coalesce the extra scatter gather elements into a single
buffer. The last descriptor is reserved and used for this coalesced buffer.

Verbs potentially need this support when transferring small data chunks
involving different memory regions.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Remove QSFP_ENABLED from HFI capability mask
Easwar Hariharan [Mon, 26 Oct 2015 14:28:31 +0000 (10:28 -0400)]
staging/rdma/hfi1: Remove QSFP_ENABLED from HFI capability mask

The QSFP interface code has been running without issues and the flag is
never set to off. This patch removes the QSFP_ENABLED bit from HFI1_CAP.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Prevent host software lock up
Vennila Megavannan [Mon, 26 Oct 2015 14:28:30 +0000 (10:28 -0400)]
staging/rdma/hfi1: Prevent host software lock up

If packets stop egressing the hardware link, software can lock up.

Implement a timeout for send context halt recovery.  This patch increases the
timeout for packet egress to 500 us and timer resets to zero if the packet
occupancy changes. Also we bounce the link on time out.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Vennila Megavannan <vennila.megavannan@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Extend the offline timeout
Dean Luick [Mon, 26 Oct 2015 14:28:29 +0000 (10:28 -0400)]
staging/rdma/hfi1: Extend the offline timeout

The latest version of the 8051 firmware will wait longer
when bringing the link down.  Extend the driver's timeout
to go with that.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Fix code to reset ASIC CSRs on FLR
Easwar Hariharan [Mon, 26 Oct 2015 14:28:28 +0000 (10:28 -0400)]
staging/rdma/hfi1: Fix code to reset ASIC CSRs on FLR

The ASIC registers were not reset on FLR, and the code to
protect the ASIC block against multiple initializations by
peer HFIs did not extend to multiple ASICs in a system. This
patch addresses this gap.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/rdma/hfi1: Fix regression in send performance
Mike Marciniszyn [Mon, 26 Oct 2015 14:28:27 +0000 (10:28 -0400)]
staging/rdma/hfi1: Fix regression in send performance

The clear_ahg call is new in hfi1 vs qib.  For small messages the progress
routine always builds one and clears out the ahg state when the queue has gone
to empty which is the predominant case for small messages.

Inline the routine and avoid the call to sdma_ahg_free to mitigate the
performance impact.  Finally, move the routine to qp.h for scope reasons.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: hfi1: sdma: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:43:25 +0000 (16:13 +0530)]
staging: hfi1: sdma: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: hfi1: driver: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:43:24 +0000 (16:13 +0530)]
staging: hfi1: driver: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove unused fields from struct sm750_dev
Mike Rapoport [Mon, 26 Oct 2015 07:06:08 +0000 (09:06 +0200)]
staging: sm750fb: remove unused fields from struct sm750_dev

The {x,y}LCD fields of struct sm750_dev are not used and can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove '#ifdef CAP_EXP*' conditionals
Mike Rapoport [Mon, 26 Oct 2015 07:06:07 +0000 (09:06 +0200)]
staging: sm750fb: remove '#ifdef CAP_EXP*' conditionals

There are several occurencies of '#ifdef CAP_EXP<something>', spelled
differently each time. None of these is ever defined and therefore they
enclose dead code that can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: merge lynx_share into sm750_dev
Mike Rapoport [Mon, 26 Oct 2015 07:06:06 +0000 (09:06 +0200)]
staging: sm750fb: merge lynx_share into sm750_dev

Both struct lynx_share and struct sm750_dev reprsent some parts of the
SM750 graphics adapter. There is no point to keep these parts in
different structures.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove unused field in lynx_cursor
Mike Rapoport [Mon, 26 Oct 2015 07:06:05 +0000 (09:06 +0200)]
staging: sm750fb: remove unused field in lynx_cursor

The lynx_share field in lynx_cursor structure is never used and can be
removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: fix wrong indentation
Mike Rapoport [Mon, 26 Oct 2015 07:06:04 +0000 (09:06 +0200)]
staging: sm750fb: fix wrong indentation

Fix wrong indentation of a line in lynxfb_set_fbinfo

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: use sm750_dev with pci_{get, set}_drvdata
Mike Rapoport [Mon, 26 Oct 2015 07:06:03 +0000 (09:06 +0200)]
staging: sm750fb: use sm750_dev with pci_{get, set}_drvdata

Use sm750_dev as private driver data for the PCI device

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: use 'struct sm750_dev *' instead of 'void *'
Mike Rapoport [Mon, 26 Oct 2015 07:06:02 +0000 (09:06 +0200)]
staging: sm750fb: use 'struct sm750_dev *' instead of 'void *'

Use proper 'struct sm750_dev *' type instead of 'void *'

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: replace lynx_share with sm750_dev in function calls
Mike Rapoport [Mon, 26 Oct 2015 07:06:01 +0000 (09:06 +0200)]
staging: sm750fb: replace lynx_share with sm750_dev in function calls

Use sm750_dev rather than lynx_share as parameter for hw_sm750_map,
hw_sm750_inithw and hw_sm750_initAccel functions.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove hw_sm750_getVMSize function
Mike Rapoport [Mon, 26 Oct 2015 07:06:00 +0000 (09:06 +0200)]
staging: sm750fb: remove hw_sm750_getVMSize function

The hw_sm750_getVMSize wraps ddk750_getVMSize without any added
functionality. Call ddk750_getVMSize directly and remove
hw_sm750_getVMSize.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: replace lynx_share with sm750_dev in lynxfb_par
Mike Rapoport [Mon, 26 Oct 2015 07:05:59 +0000 (09:05 +0200)]
staging: sm750fb: replace lynx_share with sm750_dev in lynxfb_par

Use sm750_dev instead of lynx_share in the private data of the
frambuffer device.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove unused PROC_SPEC_* typedefs
Mike Rapoport [Mon, 26 Oct 2015 07:05:58 +0000 (09:05 +0200)]
staging: sm750fb: remove unused PROC_SPEC_* typedefs

The PROC_SPEC* typedefs are not used and can be removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: merge struct sm750_state into struct sm750_dev
Mike Rapoport [Mon, 26 Oct 2015 07:05:57 +0000 (09:05 +0200)]
staging: sm750fb: merge struct sm750_state into struct sm750_dev

The struct sm750_state is never used on its own. Merge it into the
struct sm750_dev.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: rename 'struct sm750_dev' variables to sm750_dev
Mike Rapoport [Mon, 26 Oct 2015 07:05:56 +0000 (09:05 +0200)]
staging: sm750fb: rename 'struct sm750_dev' variables to sm750_dev

Use consistent naming for 'struct sm750_dev' variables

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: rename struct sm750_share to sm750_dev
Mike Rapoport [Mon, 26 Oct 2015 07:05:55 +0000 (09:05 +0200)]
staging: sm750fb: rename struct sm750_share to sm750_dev

The struct sm750_share represents the device state and name sm750_dev
seems more appropriate.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: merge sm750_hw.h into sm750.h
Mike Rapoport [Mon, 26 Oct 2015 07:05:54 +0000 (09:05 +0200)]
staging: sm750fb: merge sm750_hw.h into sm750.h

There is no actual need to split type definitions and global function
declarations between lots of small headers.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove unused smi_indent variable
Mike Rapoport [Mon, 26 Oct 2015 07:05:53 +0000 (09:05 +0200)]
staging: sm750fb: remove unused smi_indent variable

The smi_indent variable is only declared, but never used. Remove it.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: replace PADDING macro with ALIGN
Mike Rapoport [Mon, 26 Oct 2015 07:05:52 +0000 (09:05 +0200)]
staging: sm750fb: replace PADDING macro with ALIGN

The custom macro PADDING differs from standard kernel ALIGN only in
parameters order. Replace PADDING with ALIGN and remove it's definition.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: remove unused SPC_SM750 define
Mike Rapoport [Mon, 26 Oct 2015 07:05:51 +0000 (09:05 +0200)]
staging: sm750fb: remove unused SPC_SM750 define

The SPC_SM750 define is not used and can be removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: sm750fb: replace lynx_cursor methods with function calls
Mike Rapoport [Mon, 26 Oct 2015 07:05:50 +0000 (09:05 +0200)]
staging: sm750fb: replace lynx_cursor methods with function calls

The methods in lynx_cursor always use the same implementation and there is
no point to use redirection rather than direct function call.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: remove unneeded forward function declarations
Alison Schofield [Mon, 26 Oct 2015 18:44:16 +0000 (11:44 -0700)]
staging: r8723au: remove unneeded forward function declarations

Remove unneeded forward function declarations.

Addresses checkpatch.pl:
WARNING: externs should be avoided in .c files

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: move function type in line with function name
Alison Schofield [Mon, 26 Oct 2015 18:43:09 +0000 (11:43 -0700)]
staging: r8723au: move function type in line with function name

Move function types to be adjacent to the function names in
declarations to improve readability.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: insert correct spacing around operands
Alison Schofield [Mon, 26 Oct 2015 18:42:01 +0000 (11:42 -0700)]
staging: r8723au: insert correct spacing around operands

Adds required spacing around operands to improve readability.
Corrects checkpatch.pl ERROR: spaces required *

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: use kernel preferred style for commenting
Alison Schofield [Mon, 26 Oct 2015 18:36:56 +0000 (11:36 -0700)]
staging: r8723au: use kernel preferred style for commenting

Reworked comments per kernel coding style to improve readability.

Corrects checkpatch.pl:
WARNING: Block comments use * on subsequent lines
WARNING: line over 80 characters

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: Remove unnecessary variables
Amitoj Kaur Chawla [Mon, 26 Oct 2015 17:57:20 +0000 (23:27 +0530)]
staging: rtl8188eu: Remove unnecessary variables

Remove unnecessary variable that can be replaced with a single line
of code.

The semantic patch used to find this is:

// <smpl>
@@
expression ret;
@@
- if (ret) return ret;
- return 0;
+ return ret;

@@
local idexpression ret;
expression e;
@@
- ret = e;
- return ret;
+ return e;

@@
type T;
identifier i;
expression E;
@@
- T i = E;
 ... when != i

@@
type T;
identifier i;
@@
- T i;
 ... when != i
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: rtl871x_mp: Remove unused function
Amitoj Kaur Chawla [Tue, 27 Oct 2015 07:03:25 +0000 (12:33 +0530)]
staging: rtl8712: rtl871x_mp: Remove unused function

Drop unused function that is defined but is not called anywhere.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: Remove unnecessary variables
Amitoj Kaur Chawla [Mon, 26 Oct 2015 17:55:59 +0000 (23:25 +0530)]
staging: rtl8712: Remove unnecessary variables

Remove unnecessary variables that can be replaced with a single line of code.

The semantic patch used to find this is:

// <smpl>
@@
expression ret;
@@
- if (ret) return ret;
- return 0;
+ return ret;

@@
local idexpression ret;
expression e;
@@
- ret = e;
- return ret;
+ return e;

@@
type T;
identifier i;
expression E;
@@
- T i = E;
 ... when != i

@@
type T;
identifier i;
@@
- T i;
 ... when != i
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: lprocfs_status: Remove unused declaration
Shraddha Barke [Tue, 27 Oct 2015 06:35:10 +0000 (12:05 +0530)]
Staging: lustre: lprocfs_status: Remove unused declaration

Remove declaration of function lprocfs_wr_timeouts from header file
since it is not used

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: lustre_log: Remove unused functions
Shraddha Barke [Tue, 27 Oct 2015 06:35:09 +0000 (12:05 +0530)]
Staging: lustre: lustre_log: Remove unused functions

Remove the functions which are defined but not used anywhere

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: mt29f_spinand: Indent to match open parenthesis
Eva Rachel Retuya [Mon, 26 Oct 2015 16:43:45 +0000 (00:43 +0800)]
Staging: mt29f_spinand: Indent to match open parenthesis

Fix alignment issues by properly indenting function parameters in
accordance to the kernel coding style. Checkpatch pointed out this
issue.

CHECK: Alignment should match open parenthesis

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: ieee80211: Do not export static function
Amitoj Kaur Chawla [Sat, 24 Oct 2015 17:21:00 +0000 (22:51 +0530)]
staging: rtl8192u: ieee80211: Do not export static function

Remove the export symbol for static function.

The semantic patch used to find this is:

// <smpl>
@r@
type T;
identifier f;
@@

static T f (...) { ... }

@@
identifier r.f;
declarer name EXPORT_SYMBOL;
@@

-EXPORT_SYMBOL(f);
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Fixes line break
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:32 +0000 (06:09 -0700)]
staging: media: omap4iss: Fixes line break

This patch fixes the checkpatch issue:

CHECK: Logical continuations should be on the previous line

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Matches alignment with open parenthesis
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:31 +0000 (06:09 -0700)]
staging: media: omap4iss: Matches alignment with open parenthesis

This patch fixes some of the checkpatch issue:

CHECK: Alignment should match open parenthesis

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Removes unnecessary blank lines
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:30 +0000 (06:09 -0700)]
staging: media: omap4iss: Removes unnecessary blank lines

This patch fixes checkpatch issues:

CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please don't use multiple blank lines

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Replaces bit shift on 1 with BIT Macro
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:29 +0000 (06:09 -0700)]
staging: media: omap4iss: Replaces bit shift on 1 with BIT Macro

This patch fixes some of the checkpatch issue:

CHECK: Prefer using the BIT macro

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Fixes misspelling
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:28 +0000 (06:09 -0700)]
staging: media: omap4iss: Fixes misspelling

This patch fixes the checkpatch issue:

CHECK: 'splitted' may be misspelled - perhaps 'split'?

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: omap4iss: Fixes NULL comparison
Amarjargal Gundjalam [Mon, 26 Oct 2015 13:09:27 +0000 (06:09 -0700)]
staging: media: omap4iss: Fixes NULL comparison

This patch fixes the checkpatch issue:

CHECK: Comparison to NULL could be written

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: Do not use multiple blank lines.
Burcin Akalin [Mon, 26 Oct 2015 09:00:04 +0000 (12:00 +0300)]
staging: vt6656: Do not use multiple blank lines.

Remove multiple blank lines. Problem found using checkpatch.pl
"CHECK: Please don't use multiple blank lines"

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: Add space around '|'
Burcin Akalin [Mon, 26 Oct 2015 09:00:03 +0000 (12:00 +0300)]
staging: vt6656: Add space around '|'

Add space around operator '|'. Problem found using
checkpatch.pl
CHECK: spaces preferred around that '|' (ctx:VxV)

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: dummy: replace block comment with single line comment
Alison Schofield [Mon, 26 Oct 2015 20:50:29 +0000 (13:50 -0700)]
staging: iio: dummy: replace block comment with single line comment

Replace one block comment with a single line comment. Follow style of
previous comment and omit word channel, since it's clear the topic is
channels.

Addresses checkpatch.pl:
WARNING: Block comments use * on subsequent lines

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: dummy: use uppercase descriptors for enum names
Alison Schofield [Mon, 26 Oct 2015 20:48:23 +0000 (13:48 -0700)]
staging: iio: dummy: use uppercase descriptors for enum names

Replace lower case names in the enum dummy_scan_elements with
uppercase names and a descriptive prefix: DUMMY_INDEX_

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: adis16060_core: Fix error handling
Cristina Moraru [Sun, 25 Oct 2015 21:31:41 +0000 (23:31 +0200)]
staging: iio: adis16060_core: Fix error handling

We need to check adis16060_spi_read return code to avoid feeding user
space with bogus data.
While, at it introduce out_unlock label in order to simplify locking
on error path.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: Remove unused variable
Cristina Moraru [Sun, 25 Oct 2015 20:49:42 +0000 (22:49 +0200)]
staging: iio: Remove unused variable

Remove variable that is initialized but not used.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: nvec: Do not use multiple blank lines.
Burcin Akalin [Sun, 25 Oct 2015 13:23:50 +0000 (15:23 +0200)]
staging: nvec: Do not use multiple blank lines.

Remove multiple blank lines. Problem found using checkpatch.pl
"CHECK: Please don't use multiple blank lines".

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: Fixes block comment style
Amarjargal Gundjalam [Sun, 25 Oct 2015 14:48:57 +0000 (07:48 -0700)]
staging: slicoss: Fixes block comment style

This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: Adds space around operators
Amarjargal Gundjalam [Sun, 25 Oct 2015 14:48:56 +0000 (07:48 -0700)]
staging: slicoss: Adds space around operators

This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that â€˜â€™

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: Removes unnecessary space after a cast
Amarjargal Gundjalam [Sun, 25 Oct 2015 14:48:55 +0000 (07:48 -0700)]
staging: slicoss: Removes unnecessary space after a cast

This patch fixes the checkpatch.pl check:

CHECK: No space is necessary after a cast

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: Removes multiple blank lines
Amarjargal Gundjalam [Sun, 25 Oct 2015 14:48:54 +0000 (07:48 -0700)]
staging: slicoss: Removes multiple blank lines

This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fsl-mc: section mismatch bug fix
Lijun Pan [Sun, 25 Oct 2015 22:41:19 +0000 (17:41 -0500)]
staging: fsl-mc: section mismatch bug fix

WARNING: drivers/staging/built-in.o(.init.text+0xdc): Section mismatch in reference from the function fsl_mc_bus_driver_init() to the function .exit.text:dprc_driver_exit()
The function __init fsl_mc_bus_driver_init() references
a function __exit dprc_driver_exit().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
dprc_driver_exit() so it may be used outside an exit section.

Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Replace LPROCFS_CLIMP_CHECK with lprocfs_climp_check
Ksenija Stanojevic [Mon, 26 Oct 2015 15:05:57 +0000 (08:05 -0700)]
Staging: lustre: Replace LPROCFS_CLIMP_CHECK with lprocfs_climp_check

Static inline functions are preferred over macros. The function is
placed in obd_class.h instead lprocfs_status.h because obd_class.h
includes header obd.h which contains definition of struct obd_device
and in that way avoids build error: Dereferencing pointer to incomplete
type. Also remove macro LPROCFS_CLIMP_CHECK since it's no longer used.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: ptlrpc: Replace seq_printf() with seq_putc()
Amitoj Kaur Chawla [Mon, 26 Oct 2015 17:07:26 +0000 (22:37 +0530)]
staging: lustre: ptlrpc: Replace seq_printf() with seq_putc()

Replace seq_printf() with seq_putc() since it is more expensive than
seq_putc().

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: Replace sscanf with kstrtoint
Cristina Moraru [Mon, 26 Oct 2015 22:30:08 +0000 (00:30 +0200)]
staging: lustre: Replace sscanf with kstrtoint

Replace single variable sscanf with specialized function
kstrtoint at the suggestion of checkpatch.pl, to fix
'WARNING: Prefer kstrto<type> to single variable sscanf'

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: remove unused OBD_PAGE_ALLOC/FREE and friends
Mike Rapoport [Mon, 26 Oct 2015 08:06:30 +0000 (10:06 +0200)]
staging: lustre: remove unused OBD_PAGE_ALLOC/FREE and friends

The OBD_PAGE_ALLOC/FREE and related macros are not used and can be
removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: get rid of OBD_PAGE_ALLOC/FREE
Mike Rapoport [Mon, 26 Oct 2015 08:06:29 +0000 (10:06 +0200)]
staging: lustre: get rid of OBD_PAGE_ALLOC/FREE

Use alloc_page and __free_page instead

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: Don't ignore error code
Cristina Moraru [Sun, 25 Oct 2015 21:16:31 +0000 (23:16 +0200)]
staging: lustre: Don't ignore error code

Error stored in rc was never reported,
so directly return it here.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Remove unused obd_cache.h file
Shraddha Barke [Sun, 25 Oct 2015 00:26:55 +0000 (05:56 +0530)]
Staging: lustre: Remove unused obd_cache.h file

Remove the header file obd_cache.h since it is not needed

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: ptlrpc: Remove EXPORT_SYMBOL for sptlrpc_rule_set_expand
Shraddha Barke [Sun, 25 Oct 2015 00:19:42 +0000 (05:49 +0530)]
Staging: lustre: ptlrpc: Remove EXPORT_SYMBOL for sptlrpc_rule_set_expand

Since sptlrpc_rule_set_expand is static, export symbol is not needed

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: ldlm: Do not export static function
Amitoj Kaur Chawla [Sat, 24 Oct 2015 17:19:50 +0000 (22:49 +0530)]
staging: lustre: ldlm: Do not export static function

Remove the export symbol for static function.

The semantic patch used to find this is:

// <smpl>
@r@
type T;
identifier f;
@@

static T f (...) { ... }

@@
identifier r.f;
declarer name EXPORT_SYMBOL;
@@

-EXPORT_SYMBOL(f);
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: fix extreme case of comedi_nsamples_left()
Ian Abbott [Fri, 23 Oct 2015 09:56:09 +0000 (10:56 +0100)]
staging: comedi: fix extreme case of comedi_nsamples_left()

`comedi_nsamples_left(s, nsamples)` returns the number of samples
remaining to complete an asynchronous command or the passed in
`nsamples`, whichever is lower.  However, it goes wrong in the extreme
case of setting the `nsamples` parameter to `UINT_MAX` when the number
of conversions per "scan" (`s->async->cmd.scan_end_arg`) is 1.  It uses
`comedi_nscans_remaining(s, nscans)` to determine the number of scans
remaining, or the parameter `nscans`, whichever is lower.  To determine
the parameter `nscans`, it divides `nsamples` by the number of
conversions per scan and adds 1.  The addition of 1 is to avoid setting
the parameter `nscans` to 0, as `comedi_nscans_remaining(s, nscans)`
treats that value specially.  However in the extreme case where
`nsamples` is `UINT_MAX` and the number of samples per scan is 1, the
addition of 1 to `nscans` overflows, producing the unwanted 0.

Fix it by refactoring new a function `__comedi_nscans_remaining(s,
nscans)` out of `comedi_nscans_remaining(s, nscans)`.  The new function
does everything except the special handling when `nscans` is 0.  Change
`comedi_nsamples_remaining()` to call the new function without adding 1
to `nscans` to avoid the overflow.

This overflow bug doesn't affect any of the current COMEDI drivers.  I
stumbled across it while changing to one of the drivers.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: coreconfigurator: Remove unnecessary parentheses
Shivani Bhardwaj [Mon, 26 Oct 2015 14:51:26 +0000 (20:21 +0530)]
Staging: wilc1000: coreconfigurator: Remove unnecessary parentheses

Parentheses around some arguments and expressions are not required and
should be removed.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: coreconfigurator: Remove irrelevant wrapper function
Shivani Bhardwaj [Mon, 26 Oct 2015 14:51:05 +0000 (20:21 +0530)]
Staging: wilc1000: coreconfigurator: Remove irrelevant wrapper function

Remove the function get_current_channel() and replace its calls by
get_current_channel_802_11n() as the former function's definition
involves only returning the value of latter function.
Semantic patch used to find out the issue:

@@
identifier f,g;
@@

*f(...) {
 return g(...); }

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: coreconfigurator: Drop unneeded wrapper functions
Shivani Bhardwaj [Mon, 26 Oct 2015 14:46:32 +0000 (20:16 +0530)]
Staging: wilc1000: coreconfigurator: Drop unneeded wrapper functions

Replace the wrapper functions get_address1(), get_address2() and get_address3()
with the standard kernel function ether_addr_copy().
Semantic patch used to identify the issue:

@@
identifier f,g;
@@

*f(...) {
 g(...); }

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: return -ENOMEM when kmalloc failed
Luis de Bethencourt [Mon, 26 Oct 2015 05:52:50 +0000 (05:52 +0000)]
staging: wilc1000: return -ENOMEM when kmalloc failed

The driver is using -1 instead of the -ENOMEM defined macro to specify that
a buffer allocation failed.

Fixes smatch warning and similars:
drivers/staging/wilc1000/host_interface.c:1757 Handle_Key() warn:
returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename host_int_set_WEPDefaultKeyID
Chaehyun Lim [Mon, 26 Oct 2015 00:44:45 +0000 (09:44 +0900)]
staging: wilc1000: rename host_int_set_WEPDefaultKeyID

This patch replaces host_int_set_WEPDefaultKeyID with
host_int_set_wep_default_key to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename u8Index in host_int_set_WEPDefaultKeyID
Chaehyun Lim [Mon, 26 Oct 2015 00:44:44 +0000 (09:44 +0900)]
staging: wilc1000: rename u8Index in host_int_set_WEPDefaultKeyID

This patch changes second parameter of host_int_set_WEPDefaultKeyID from
u8Index to index to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: fix parameter name of function declaration
Chaehyun Lim [Mon, 26 Oct 2015 00:44:43 +0000 (09:44 +0900)]
staging: wilc1000: fix parameter name of function declaration

This patch changes struct host_if_drv of host_int_set_WEPDefaultKeyID
function declaration from hWFIDrv to hif_drv in host_interface.h
With this change, first parameter name of this function declaration and
definition has same name as hif_drv.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: fix return type of host_int_set_WEPDefaultKeyID
Chaehyun Lim [Mon, 26 Oct 2015 00:44:42 +0000 (09:44 +0900)]
staging: wilc1000: fix return type of host_int_set_WEPDefaultKeyID

This patch changes return type of host_int_set_WEPDefaultKeyID from s32
to int. The result variable gets return value from wilc_mq_send that has
return type of int. It should be changed return type int as well as data
type of result variable.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoMerge 4.3-rc7 into staging-next
Greg Kroah-Hartman [Tue, 27 Oct 2015 00:13:38 +0000 (09:13 +0900)]
Merge 4.3-rc7 into staging-next

We want the other staging patches in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: Remove boolean comparision
Punit Vara [Sat, 24 Oct 2015 22:31:25 +0000 (04:01 +0530)]
Staging: wilc1000: Remove boolean comparision

This patch is to the host_interface.c file that fixes up following
warning reported by coccicheck:

WARNING: Comparison to bool

Boolean tests do not need explicit comparison to true or false

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rdma: amso1100: Drop unnecessary goto
Amitoj Kaur Chawla [Sat, 24 Oct 2015 16:39:05 +0000 (22:09 +0530)]
staging: rdma: amso1100: Drop unnecessary goto

Deletes the jump to a label on the next line when the label isn't used
anywhere else.

The semantic patch used to find this is:

// <smpl>
@r@
identifier l;
@@

-if (...) goto l;
-l:
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rdma: hfi1: chip: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:43:23 +0000 (16:13 +0530)]
staging: rdma: hfi1: chip: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: mt29f_spinand: Prefer using the BIT macro
Eva Rachel Retuya [Sat, 24 Oct 2015 14:35:47 +0000 (22:35 +0800)]
Staging: mt29f_spinand: Prefer using the BIT macro

Replace all instances of bit shifting on 1 with the BIT(x) macro. In
addition, convert other non-1 shift operations with the equivalent
BIT(x) macro for uniformity. Issue pointed out by checkpatch.

CHECK: Prefer using the BIT macro

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: mt29f_spinand: Replace udelay function with usleep_range
Eva Rachel Retuya [Sat, 24 Oct 2015 17:24:51 +0000 (01:24 +0800)]
Staging: mt29f_spinand: Replace udelay function with usleep_range

Use 'usleep_range' instead of 'udelay' to elapse time. For
spinand_reset, define the upper limit by a factor of 2 to keep the wait
short while still allowing a "good enough" range for wakeup. Define the
range 250us - 1ms for spinand_cmdfunc to provide enough leeway before
issuing spinand_reset. Checkpatch found this issue.

CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ipath: ipath_init_chip: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:17:31 +0000 (15:47 +0530)]
staging: ipath: ipath_init_chip: Use setup_timer

Use of the timer API function setup_timer instead of init_timer, removing
the structure field assignments, and make the codeflow more readable.
The simplified sematic patch used is :-
<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ipath: ipath_sdma: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:17:32 +0000 (15:47 +0530)]
staging: ipath: ipath_sdma: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ipath: ipath_verbs: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:17:33 +0000 (15:47 +0530)]
staging: ipath: ipath_verbs: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ipath: ipath_driver: Use setup_timer
Muhammad Falak R Wani [Sun, 25 Oct 2015 10:17:30 +0000 (15:47 +0530)]
staging: ipath: ipath_driver: Use setup_timer

Use the timer API function setup_timer instead of init_timer, removing
the structure field assignments.
The simplified semantic patch used is :-
<smpl>

@timer@
expression e1,e2,e3,fn_ptr;
@@
-init_timer(&e1);
+setup_timer(&e1, fn_ptr, e2);
... when != fn_ptr = e3
-e1.function = fn_ptr;
-e1.data = e2;

</smpl>

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: remove externs and include needed header file
Alison Schofield [Sat, 24 Oct 2015 04:33:34 +0000 (21:33 -0700)]
staging: r8723au: remove externs and include needed header file

Remove extern declaration and add include of header file to get same.

Addresses checkpatch.pl:
WARNING: externs should be avoided in .c files

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: replace explicit NULL comparisons with !
Alison Schofield [Sat, 24 Oct 2015 04:32:20 +0000 (21:32 -0700)]
staging: r8723au: replace explicit NULL comparisons with !

Replace explicit NULL comparison with ! operator to simplify code.

Addresses checkpatch.pl:
WARNING: Comparisons should place the constant on the right side of the
test

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: r8723au: use kernel preferred style for commenting
Alison Schofield [Sat, 24 Oct 2015 04:28:00 +0000 (21:28 -0700)]
staging: r8723au: use kernel preferred style for commenting

Reworked comments per kernel coding style to improve readability.

Corrects checkpatch.pl:
WARNING: Block comments use * on subsequent lines
WARNING: line over 80 characters

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wlan-ng: Do not use multiple blank lines.
Burcin Akalin [Fri, 23 Oct 2015 21:30:03 +0000 (00:30 +0300)]
staging: wlan-ng: Do not use multiple blank lines.

Remove multiple blank lines. Problem found using checkpatch.pl
"CHECK: Please don't use multiple blank lines"

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: speakup: Remove multiple assignments
Burcin Akalin [Fri, 23 Oct 2015 19:12:14 +0000 (22:12 +0300)]
staging: speakup: Remove multiple assignments

Remove multiple assignments by factorizing them.Problem found using
checkpatch.pl
CHECK: multiple assignments should be avoided

Signed-off-by: Burcin Akalin <brcnakalin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: Remove unnecessary braces and tab spacing
Amitoj Kaur Chawla [Fri, 23 Oct 2015 18:14:48 +0000 (23:44 +0530)]
staging: vt6656: Remove unnecessary braces and tab spacing

This patch removes unnecessary braces around if-else single statement
blocks and unnecessary tab space aligning

Tool used is uncrustify.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8723au: Use put_unaligned_le32
Shraddha Barke [Fri, 23 Oct 2015 14:27:52 +0000 (19:57 +0530)]
Staging: rtl8723au: Use put_unaligned_le32

Introduce the use of function put_unaligned_le32.

A simplified version of Coccinelle semantic patch used -

@@ identifier tmp; expression ptr; expression y,e; type T; @@

- tmp = cpu_to_le32(y);

  <+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le32(y,ptr);
  ...+>
? tmp = e

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: fix voltage settings for C-Berry28
Dennis Menschel [Wed, 21 Oct 2015 21:16:56 +0000 (23:16 +0200)]
staging: fbtft: fix voltage settings for C-Berry28

This patch fixes some internal voltage settings for the C-Berry28 display.
The original example source files for the C-Berry28 as provided by
its vendor admatec contained six issues where a command parameter's value
didn't match its corresponding comment.
I've informed admatec about these discrepancies on 2015-08-25. In the
meantime, I've assumed the comments to be more reliable than the code,
and thus have used these values to write the initial C-Berry28 driver.
After having received a reply from admatec on 2015-10-16 that the issues
have been fixed in their example code, it has turned out that for the
voltages VCOM and AVDD, the code was indeed correct, but the comments
were wrong. This patch is meant to fix these two pending mistakes.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: use init function instead of init sequence
Dennis Menschel [Wed, 21 Oct 2015 21:16:55 +0000 (23:16 +0200)]
staging: fbtft: use init function instead of init sequence

This patch converts the default init sequence of the ST7789V
display controller into an init function, as init sequences
are considered deprecated by the maintainers of fbtft.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: remove redundant set_addr_win() function
Dennis Menschel [Wed, 21 Oct 2015 21:16:54 +0000 (23:16 +0200)]
staging: fbtft: remove redundant set_addr_win() function

This patch removes the function set_addr_win() from fb_st7789v.c, as its
definition is redundant to the default implementation fbtft_set_addr_win()
which can be found in fbtft-core.c.

Signed-off-by: Dennis Menschel <menschel-d@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>