Commit graph

575106 commits

Author SHA1 Message Date
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
Oleg Drokin a3fbcb3c27 staging/lustre/libcfs: Update comments style to match kernel
checkpatch complains that the trailing */ on the multiline comments
should be on it's own line.

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 69c7c854d6 staging/lustre/libcfs: Move private tracefile structs out of header
the struct page_collection, struct cfs_trace_page and
struct tracefiled_ctl are only used by tracefile.c, so move them
there.

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 6918d1f65f staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function
Does not appear to be used anywhere.

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 417ad15656 staging/lustre/libcfs: Shortened too long lines
Lines that were too long for not good reason were shortened in this patch.
Found with checkpatch.

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 ad6eb8bbf4 staging/lustre/libcfs: Remove stray spaces after function name
Problem highlighted by checkpatch.

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 36355e390c staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define
Avoid using leading spaces that make checkpatch unhappy.

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 60b156e3cd staging/lustre/libcfs: style change to add missing spaces for operations
This fixes checkpatch messages about
"spaces preferred around that '-' (ctx:VxV)"

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 22628c7d09 staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable
Found with checkpatch

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 ae0b4833cc staging/lustre/libcfs: Cleanup: parenthesis alignment adjustments
Adjust alignment of argments that were pushed to next lines
to conform to kernel code style.
Found with checkpatch.

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 1f2f80c1cc staging/lustre: Remove the "write to FSF to get a copy of GPL" wording
Checkpatch highlighted that some of our Lustre files carry this
extra paragraph and indeed it does seem somewhat redundant, so remove it.

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 8b38208992 staging/lustre/ptlrpc: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 7f1ae4c066 staging/lustre/osc: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 7ae59edacf staging/lustre/obdecho: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 cce3c2da7c staging/lustre/obdclass: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 eb17cc2454 staging/lustre/mgc: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 34e3ff962f staging/lustre/mdc: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 d2a13989d2 staging/lustre/include: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.

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 eb26ebb86a staging/lustre/lclient: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

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 6ac49ca562 staging/lustre/fld: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

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 6a9f7487f0 staging/lustre/fid: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

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