Commit graph

575126 commits

Author SHA1 Message Date
Laura Garcia Liebana
4b032eb7bd staging: netlogic: Fix comparison to NULL
Avoid the use of comparison to NULL, use !<variable> instead. Checkpatch
detected these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
a5cecac645 staging: netlogic: Fix CamelCase for constants
Avoid the use of CamelCase for constants. Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
06409808e3 staging: netlogic: Fix multiple assignments
Avoid the use of multiple assignments in a single line. Checkpatch found
this issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
c8550db532 staging: netlogic: Remove blank spaces after a cast
Remove uneeded blank spaces after a cast. Checkpatch found these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
3a694d0c29 staging: netlogic: Fix several parentheses alignments
Align arguments with the open parenthesis. Checkpatch found these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Thaissa Falbo
c3397c1b06 staging: media: davinci_vpfe: remove ret variable in switch statements
Remove ret variable in functions that used it to determine the return.
Simplified the return logic for these functions.

Found with Coccinelle script:

@@
local idexpression ret;
expression c,d;
identifier label;
@@

switch ( ... ) {
case label :
...
- ret = c;
- break;
+ return c;
...
default:
...
- ret = d;
+ return d;
...
}
... when != ret
- return ret;

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

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
afa5d19a2b staging: media: davinci_vpfe: remove unnecessary ret variable
Simplified return of funcions by removing assignment of ret variable.

Coccinelle script used:

@@
local idexpression ret;
expression e;
@@

- ret = e;
- if(ret)
-       return ret;
+ if(e)
+       return e;

@@
local idexpression ret;
expression e;
@@

- ret = e;
- return ret;
+ return e;

@@
local idexpression ret;
expression e;
@@

- ret = e;
- if(ret){
+ if(e){
        ... when != ret
-       return ret;
+       return e;
}

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

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
8e8919feb6 staging:media:davinci_vpfe: Fix lines over 80 characters
Fix "line over 80 characters" checkpatch warnings

WARNING: line over 80 characters

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
735a8b4561 staging:media:davinci_vpfe: Fixed code identation warning as detected by checkpatch
Fixed code indentation warning as detected by checkpatch.

WARNING: suspect code indent for conditional statements (24, 40)
#1672: FILE: drivers/staging/media/davinci_vpfe/dm365_resizer.c:1672:

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:32 -08:00
Thaissa Falbo
b369a87c3c staging:media:davinci_vpfe: Fixed comparisons with constants warnings
WARNING: Comparisons should place the constant on the right side of the
test

Fixed warnings by moving the constants to the right side of the comparisons.

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:32 -08:00
Thaissa Falbo
9c5d89338e staging:media:davinci_vpfe: Fixed block comments according to kernel coding style
Fixed block comments by following the checkpatch warnings

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

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:32 -08:00
Amitoj Kaur Chawla
72a5f6a8df staging: rdma: hfi1: Use offset_in_page macro
Use offset_in_page macro instead of (var & ~PAGE_MASK)

The Coccinelle semantic patch used to make this change is as follows:
// <smpl>
@@
unsigned long p;
@@
- p & ~PAGE_MASK
+ offset_in_page(p)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Amitoj Kaur Chawla
809487c703 staging: rdma: hfi1: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)) but is perhaps more readable.

The Coccinelle script used is as follows:

// <smpl>
@@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@@
expression n,d;
@@
- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)
@@
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Amitoj Kaur Chawla
94b397cd25 staging: rdma: hfi1: Replace kmalloc and memcpy with kmemdup
Replace kmalloc and memcpy with kmemdup. Found using Coccinelle.

The semantic patch used to make this change can be found here:
scripts/coccinelle/api/memdup.cocci

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Fu Yong Quah
1e613801ce staging: wlan-ng: fix NULL comparison
Fix NULL equality comparision by changing it with exclamation mark,
as suggested by Documentation/CodingStyle

Signed-off-by: Fu Yong Quah <fuyong@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Amitoj Kaur Chawla
5be2f42b50 staging: wlan-ng: Remove flush_scheduled_work
flush_scheduled_work() is scheduled for deprecation. Use
cancel_work_sync() instead to ensure that there is no pending or
running work item.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal
896774f631 Staging: wlan-ng: Remove unused functions and prototypes
hfa384x_drvr_getconfig_async is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file. Also
the function hfa384x_cb_rrid was only used by hfa384x_drvr_getconfig_async
so remove its definition and prototype as well.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal
49e845a087 Staging: wlan-ng: Remove function hfa384x_drvr_commtallies
The function hfa384x_drvr_commtallies is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Eva Rachel Retuya
b5b6e7beb0 staging: iio: resolver: fix comparison to NULL
Remove comparison of spi->dev.platform_data to NULL by replacing it with
'!spi->dev.platform_data' as checkpatch suggested:

CHECK: Comparison to NULL could be written "!spi->dev.platform_data"

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
c7e426d1c5 staging: iio: resolver: remove unnecessary blank line
Delete the excess newline. Issue found by checkpatch.

CHECK: Please don't use multiple blank lines

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
c3f63dd6fe staging: iio: resolver: delete space after a cast
Delete unwanted whitespace after casting. Issue pointed out by
checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
84681c7c85 staging: iio: resolver: add missing braces on if-else statements
Add braces around the else clause to adhere to kernel coding style. This
clears the following checkpatch issue:

CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
8d80ccbb1e staging: iio: resolver: use blank line after array declaration
Add a blank line after array declaration. This clears the checkpatch
check:

CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
cdd6dee0f1 staging: iio: resolver: add spaces around operators
Add spaces around operators to improve readability and to address the
checkpatch issue:

CHECK: spaces preferred around that '/' (ctx:VxV)

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
ae6394aaf1 staging: iio: resolver: align to match open parenthesis
Use a combination of tabs and spaces to align parameters to its
corresponding open parenthesis. Checkpatch found this issue.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya
ddab4a02c4 staging: iio: light: fix multiple assignments in a single line
Rewrite the multiple assignments to clear checkpatch check:

CHECK: multiple assignments should be avoided

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya
e537daa198 staging: iio: light: add space around '*"
Address checkpatch check pointing out the lack of space around the
operator '*'.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya
7f3829a354 staging: iio: light: fix block comments according to kernel coding style
Add the trailing */ accordingly to suit the preferred way of placing
block comments.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya
79783b31d5 staging: iio: light: omit space after a cast
Remove the unneeded space as pointed out by checkpatch:
CHECK: No space is necessary after a cast

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya
ca52c88cac staging: iio: light: indent to match open parenthesis
Indent the parameters to match open parenthesis as suggested by checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Janani Ravichandran
911568be45 staging: iio: accel: Remove unnecessary else after goto in if block
This patch removes the unnecessary else following an if block with a
goto statement.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:05 -08:00
Amitoj Kaur Chawla
0fd736f9f4 staging: iio: adc: Remove unnecessary test from if conditions
Remove unnecessary test condition on ret variable which has been
previously tested and returns its value if the value is non zero.

This fixes the following smatch warnings:
drivers/staging/iio/adc/ad7816.c:299 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'
drivers/staging/iio/adc/ad7816.c:306 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:43:48 -08:00
Bhumika Goyal
6a707a9eb9 Staging: wilc1000: Remove and rename struct typedefs from .c files
Using typedef for a structure type is not suggested in Linux kernel coding
style guidelines. So remove typedefs from structures wilc_sdio_t,
wilc_spi_t and wilc_mac_cfg_t.
Also remove '_t' suffix from the struct names by hand.

The following semantic patch detects cases:

@tn1@
type td;
@@

typedef struct { ... } td;

@script:python tf@
td << tn1.td;
tdres;
@@
coccinelle.tdres = td;

@@ type tn1.td;
identifier tf.tdres;
@@
-typedef
 struct
+ tdres
  { ... }
-td
  ;
@@ type tn1.td;
identifier tf.tdres;
@@
-td
+ struct tdres

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:43:48 -08:00
Bhumika Goyal
5bc32160c5 Staging: wilc1000: Remove unused function WILC_WFI_update_stats
This patch removes the function WILC_WFI_update_stats as it is not used
anywhere in the kernel. Also remove its declaration from the header
file. Grepped to find the occurences.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:43:48 -08:00
Bhumika Goyal
541ac71337 Staging: lustre: lnet: Remove and rename struct typedef lstcon_session_t
This patch gets rid of struct typedef lstcon_session_t as it is not
suggested to use typdefs for structure types. Also drop '_t' from the name.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:39:54 -08:00
Amitoj Kaur Chawla
a6e19b4d4f staging: lustre: Replace __attribute__((packed)) with __packed
This patch fixes the following checkpatch.pl warning:
"WARNING: __packed is preferred over __attribute__((packed))".

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:39:54 -08:00
Janani Ravichandran
6c441b971d staging: lustre: lustre: Remove unneeded else after goto
Remove unnecessary else following an if block with a goto statement.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:39:54 -08:00
Janani Ravichandran
7d51a7dab7 staging: lustre: lustre: Remove unnecessary else after return
Else is unnecessary when there is a return statement in the
corresponding if block. Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-       }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
		s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:39:54 -08:00
Bhumika Goyal
496baea013 Staging: lustre: lov: Pull assignments out of function call
Assignments in function call arguments are undesirable. So pull such
assignments out before function call.
Made a coccinelle script to detect such cases:
@@
expression fn,b,d;
@@
* fn(...,d=b,...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:38:33 -08:00
Amitoj Kaur Chawla
f51e5a202e staging: lustre: osc: osc_request: Declare local function and structure as static
Declare osc_cleanup() function and osc_obd_ops structure as static
since they are defined and called only in this file.

Removed osc_cleanup() function prototype since it wasn't required.

This fixes the following sparse warnings:
drivers/staging/lustre/lustre/osc/osc_request.c:3210:5: warning:
symbol 'osc_cleanup' was not declared. Should it be static?
drivers/staging/lustre/lustre/osc/osc_request.c:3259:16: warning:
symbol 'osc_obd_ops' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:38:33 -08:00
Amitoj Kaur Chawla
8cee691ea8 staging: lustre: obdclass: obd_mount: Declare function as static
Declare lustre_mount() function static since it is defined and called in this
file only.

This fixes the following sparse warning:
drivers/staging/lustre/lustre/obdclass/obd_mount.c:1169:15: warning:
symbol 'lustre_mount' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:37:02 -08:00
Shalin Mehta
0a37f7a6a2 staging: lustre: Fixed the parenthesis
The parentehsis are fixed in the macro for the ldlm lock to set and
clear the flags.

Signed-off-by: Shalin Mehta <shalinmehta85@gmail.com>
Acked-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:37:02 -08:00
Oleg Drokin
ae0246da16 staging/lustre: Convert cfs_str2num_check to use kstrtoul
simple_strtoul is obsolete

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
4d8a00ef54 staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul
simple_strtoul is obsolete

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
3e1f3db1b2 staging/lustre: Remove space after cast in cfs_crypto_hash_final()
This is against kernel-code style.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
34ec7f895a staging/lustre/libcfs: Get rid of multiple assignments
They make checkpatch unhappy, and I guess overall might confuse
people too.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
4a44ab6848 staging/lustre: Get rid of cfs_trace_buf_type_t typedef
Replace it with enum cfs_trace_buf_type

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
4d8efec271 staging/lustre: Update cfs_cpu_notify switch statement with a comment
We do really mean to fall through to that default case statement from
all previous ones, so add a comment to unconfuse verious tools

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
cd84f6cc5c staging/lustre/libcfs: Remove empty lines after/before braces
No need for an empty line after opening curvy brace and no need
for an empty line before the closing one too.
Remove them.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00
Oleg Drokin
b366e6c902 staging/lustre/libcfs: Remove useless returns in void functions
Return at the end of a void function does not serve any particular
purpose and makes checkpatch unhappy, so eliminate them.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:33:11 -08:00