- 20 Feb, 2016 40 commits
-
-
Thaissa Falbo authored
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>
-
Thaissa Falbo authored
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>
-
Thaissa Falbo authored
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>
-
Thaissa Falbo authored
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>
-
Thaissa Falbo authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Fu Yong Quah authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Bhumika Goyal authored
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>
-
Bhumika Goyal authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Eva Rachel Retuya authored
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>
-
Janani Ravichandran authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Bhumika Goyal authored
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>
-
Bhumika Goyal authored
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>
-
Bhumika Goyal authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Janani Ravichandran authored
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>
-
Janani Ravichandran authored
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>
-
Bhumika Goyal authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Amitoj Kaur Chawla authored
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>
-
Shalin Mehta authored
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>
-
Oleg Drokin authored
simple_strtoul is obsolete Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
simple_strtoul is obsolete Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
This is against kernel-code style. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Oleg Drokin authored
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>
-