This patch removes the conditional return of the ade77*_probe functions
based on the return values of iio_device_register as the latter
returns 0 or ret, the same as the checked values.
Haneen Mohammed [Fri, 13 Mar 2015 17:47:22 +0000 (20:47 +0300)]
Staging: iio: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:
@rule1@
identifier x, y, z;
expression E1, E2;
@@
(
x = (y == z);
|
x = (E1 == E2);
|
x =
-(
...
-)
;
)
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haneen Mohammed [Fri, 13 Mar 2015 16:55:55 +0000 (19:55 +0300)]
Staging: rtl8188eu: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:
@rule1@
identifier x, y, z;
expression E1, E2;
@@
(
x = (y == z);
|
x = (E1 == E2);
|
x =
-(
...
-)
;
)
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vaishali Thakkar [Wed, 11 Mar 2015 06:11:24 +0000 (11:41 +0530)]
Staging: rtl8188eu: Eliminate use of _init_timer
This patch introduces the use of API function setup_timer
instead of driver specific function init_timer as it is
the preferred and standard way to set and setup the timer.
To be compatible with the changes, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.
Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:
@@ expression x, y; identifier a, b;@@
- _init_timer (&x, y, a, b);
+ setup_timer (&x, a, (unsigned long)b);
Vaishali Thakkar [Wed, 11 Mar 2015 06:11:07 +0000 (11:41 +0530)]
Staging: rtl8188eu: Eliminate use of _set_timer
This patch introduces the use of API function mod_timer
instead of driver specific function _set_timer as it is
a more efficient and standard way to update the expire
field of an active timer. Also, definition of function
_set_timer is removed as it is no longer needed after
this change.
Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:
This patch removes the RTLLIB_PRINT_STR macro definition because it's
only defined in the header and it's never referenced. It also removes
PRINTABLE and MAX_STR_LEN, which were defined as helpers for the first
one.
Sudip Mukherjee [Tue, 10 Mar 2015 09:44:58 +0000 (15:14 +0530)]
staging: rtl8192e: remove unused functions
removed some functions which were not being used anywhere.
build tested and also verified by git grep that there is no other
reference to these functions.
Haneen Mohammed [Fri, 13 Mar 2015 17:50:52 +0000 (20:50 +0300)]
Staging: rtl8192u: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:
@rule1@
identifier x, y, z;
expression E1, E2;
@@
(
x = (y == z);
|
x = (E1 == E2);
|
x =
-(
...
-)
;
)
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: rtl8192u: Remove unnecessary struct and typedef
This patch removes the _bss_ht struct and the associated type definition
because it is not used and it also introduces the warning:
"WARNING: do not add new typedefs".
This patch detects the cases in which a variable is not modified through
the code and it is used as a return value. The variable is detected and
removed by coccinelle using the following semantic patch:
@@ type T; expression expr; identifier r; constant c; @@
-T r = expr;
... when != r
when strict
-return r;
+return expr;
Staging: rtl8192u: Convert use of __constant_<foo> to <foo>
Using functions of the form __constant_<foo> isn't preferred
outside of include/uapi/ as using the function without
__constant_ is identical when the argument is a constant.
So, this patch replaces __constant_htons with htons.
This is done using Coccinelle and semantic patch used for
this is as follows:
Use timer API function del_timer_sync instead of driver
specific function _cancel_timer as besides deactivating
a timer, it also ensures that the timer is stopped on all
CPUs before the driver exists. Also, variables
timer_cancelled and bool are removed as they are no longer
needed.
Staging: rtl8712: Eliminate use of _cancel_timer_ex
Use timer API function del_timer_sync instead of driver
specific function _cancel_timer_ex as besides deactivating
a timer, it ensures that the timer is stopped on all
CPUs before the driver exists. Also, definition of function
_cancel_timer_ex is removed as it is no longer needed after
this change.
This is done using Coccinelle and semantic patch used for
this is as follows:
Haneen Mohammed [Fri, 13 Mar 2015 11:29:30 +0000 (14:29 +0300)]
Staging: comedi: Remove parentheses around right side assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurences. Issue was detected and
solved using the following coccinelle script:
@rule1@
identifier x, y, z;
expression E1, E2;
@@
(
x = (y == z);
|
x = (E1 == E2);
|
x =
-(
...
-)
;
)
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Supriya Karanth [Wed, 11 Mar 2015 16:11:00 +0000 (01:11 +0900)]
staging: sm750fb: Add void to function definition with no arguments
Found by checkpatch.pl - ERROR: Bad function definition
A function with no arguments allows for variadic arguments. Add
void in between the empty parentheses to indicate that the function
takes no arguments.
changes made using coccinelle script:
@@
type T;
identifier f;
@@
T f(
+void
) {
...
}
Aya Mahfouz [Tue, 10 Mar 2015 17:04:09 +0000 (19:04 +0200)]
staging: ft1000: ft1000-usb: ft1000_hw.c: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to pointer casts.
Issues were detected using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, there were some
cases that were handled manually. In addition, handling pointer casts
were done manually too because not all replacements generated by the
script were suitable. When pointer casts on function arguments were
in the form:
<func>(...,(<type> *)&<expression>,...)
the replacements were discarded due to compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Tue, 10 Mar 2015 17:03:18 +0000 (19:03 +0200)]
staging: ft1000: ft1000-usb: ft1000_download.c: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to pointer cast.
Issues were detected using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, handling pointer
casts were done manually because not all replacements generated by the
script were suitable. In general, the following cases were discarded:
pointer casts in macros,
pointer casts on function arguments in the form of:
<func>(...,(<type> *)&<expression>,...)
since both cases generated compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Tue, 10 Mar 2015 17:02:29 +0000 (19:02 +0200)]
staging: ft1000: ft1000-usb: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to pointer cast.
Issues were detected using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, handling pointer
casts were done manually because not all replacements generated by the
script were suitable. In general, the following cases were discarded:
pointer casts in macros,
pointer casts on function arguments in the form of:
<func>(...,(<type> *)&<expression>,...)
since both cases generated compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Tue, 10 Mar 2015 17:01:41 +0000 (19:01 +0200)]
staging: ft1000: ft1000-pcmcia: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to potinter cast.
Issues were detected using the following coccinelle
script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, handling pointer
casts were done manually because not all replacements generated by the
script were suitable. In general, the following cases were discarded:
pointer casts in macros,
pointer casts on function arguments in the form of:
<func>(...,(<type> *)&<expression>,...)
since both cases generated compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Aya Mahfouz [Tue, 10 Mar 2015 16:58:00 +0000 (18:58 +0200)]
staging: mt29f_spinand: remove pointer to pointer cast in function argument
Removes unnecessary pointer to pointer cast on function arguments.
It is worth noting that buf is already a u8 pointer.
Issue detected and resolved using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Somya Anand [Fri, 13 Mar 2015 19:33:10 +0000 (01:03 +0530)]
Staging: lustre: Iterate list using list_for_each_entry
Code using doubly linked list is iterated generally using list_empty and
list_entry functions, but it can be better written using list_for_each_entry
macro.
This patch replaces the while loop containing list_empty and list_entry with
list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
macro which is used to iterate over a list of given type. So while loop used to
iterate over a list can be replaced with list_for_each_entry macro. However, if
list_del is used in the loop, then list_for_each_entry_safe is a better choice.
This transformation is done by using the following coccinelle script.
@ rule1 @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry;
@@
- while (list_empty(&E1) == 0)
+ list_for_each_entry (I1, &E1, I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...when != list_del(...);
when != list_del_init(...);
}
@ rule2 @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@
T *I1;
+ T *tmp;
...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}
Haneen Mohammed [Fri, 13 Mar 2015 17:48:53 +0000 (20:48 +0300)]
Staging: lustre: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:
@rule1@
identifier x, y, z;
expression E1, E2;
@@
(
x = (y == z);
|
x = (E1 == E2);
|
x =
-(
...
-)
;
)
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: rtl8192u: Replace printk() with netdev_dbg()
This patch replaces the printk() function with netdev_dbg() in order to
fix the following: "WARNING: printk() should include KERN_ facility level"
and "WARNING: line over 80 characters".
Staging: rtl8192u: Add function to improve code quality
This patch introduces a new function for the authentication response
error check in the ieee80211_rx_frame_softmac() function to fix the
indentation problem. It also adds the iotAction variable in the new
function to fix the "more than 80 characters per line" warning.
Somya Anand [Mon, 9 Mar 2015 13:48:24 +0000 (19:18 +0530)]
Staging: rtl8188eu: Remove redundant local variable
This patch removes a redundant variable "val" and adds
inline return statements. It also adds a default case
to the switch statement which returns 0 to keep the logic
intact.
It also removes a redundant variable "inx" and adds inline
return statements.
This issue is identified by the following coccinelle script.
@@
expression ret;
identifier f;
@@
Somya Anand [Wed, 11 Mar 2015 11:32:12 +0000 (17:02 +0530)]
Staging: dgnc: Remove redundant parentheses
This patch removes the redundant parentheses inorder to make code
simplified. While doing this, the precedence order of the operation
is taken into consideration to keep the logic of the code intact.
Remove FSF address because it's known in the past that it has changed.
Also, remove the pointless "do not change the coding style" comments
because it's one of the reasons why it's in staging and it's quite
contradictory to what it says in TODO. Also, they contain wrong e-mails
of people which are responsible for these drivers - see TODO or
MAINTAINERS for that. We can preserve the original copyright at the top
of the most files because it shows who originally made them.
Dan Carpenter [Tue, 10 Mar 2015 07:39:42 +0000 (10:39 +0300)]
staging: dgnc: off by one in dgnc_mgmt_ioctl()
"dgnc_NumBoards" is the number of initialized elements in the
dgnc_Board[] array so the comparison should be ">=" instead of ">" so we
don't read invalid data. We can remove the special handling of the
empty array now that we've fixed this bug.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dgnc: Make all lines under 80 characters in dgnc_driver.c
Some of the lines are over 80 characters in dgnc_driver.c so fix them by
moving the comments closer to the code, tidying the comments to make
them smaller, and remove a redundant space after +.
There are a lot double of blank lines in dgnc_cls.c thus remove them to make
the file follow the CodingStyle. Also, remove one blank line at the
end of dgnc_cls.c.
Staging: sm750fb: provide error path for hw_sm750le_setBLANK()
This provides a default path for the switch statement in
hw_sm750le_setBLANK() so that the compiler will not correctly complain
about undefined values being sent to the hardware.
Instead, properly error out if the blank command is unknown by the
driver.
Staging: sm750fb: fix build warning with lynx_accel
Change the return value of lynx_accel to be void, to fix the build
warning, and due to the fact that the function can't seem to fail at
all, and no one cares if it does or not.
Staging: sm750fb: fix build warning with proc_panDisplay
Change the options to the proc_panDisplay function pointer to match the
function pointer that we want to assign to it, in order to remove the
build warning.
Lorenzo Stoakes [Tue, 10 Mar 2015 15:25:47 +0000 (15:25 +0000)]
staging: sm750fb: Cleanup the type of mmio750
This patch assigns the more appropriate void* type to the mmio750 variable
eliminating an unnecessary volatile qualifier in the process. Additionally it
updates parameter types as necessary where those parameters interact with
mmio750, removes unnecessary casts and updates the type of the
lynx_share->pvReg field which is passed to the ddk750_set_mmio method.
As a consequence, this patch fixes the following sparse warning:-
drivers/staging/sm750fb/ddk750_help.c:12:17: warning: incorrect type in assignment (different address spaces)
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>