diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2015-03-31 22:22:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-01 18:26:58 +0300 |
commit | 5c7d08c32d0cb96ec0e831539bb68b7fe5b45973 (patch) | |
tree | 33b7685e7765cb154715e1021ac96b4b1e98957e /drivers/staging/rtl8712 | |
parent | b6955a8f4350686321ccc4efd2b2333d91c5c2f5 (diff) | |
download | linux-5c7d08c32d0cb96ec0e831539bb68b7fe5b45973.tar.xz |
Staging: rtl8712: Remove zero-testing pointer typed value
Removes variable comparison with 0 by using !. Done using following
coccinelle script.
@ disable is_zero,isnt_zero @
expression *E;
expression E1,f;
@@
E = f(...)
<...
(
- E == 0
+ !E
|
- E != 0
+ E
|
- 0 == E
+ !E
|
- 0 != E
+ E
)
...>
?E = E1
@ disable is_zero,isnt_zero @
expression *E;
@@
(
E ==
- 0
+ NULL
|
E !=
- 0
+ NULL
|
- 0
+ NULL
== E
|
- 0
+ NULL
!= E
)
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_security.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c index a178c232b44a..bcd1a5128868 100644 --- a/drivers/staging/rtl8712/rtl871x_security.c +++ b/drivers/staging/rtl8712/rtl871x_security.c @@ -153,7 +153,7 @@ static u32 getcrc32(u8 *buf, u32 len) u8 *p; u32 crc; - if (bcrc32initialized == 0) + if (!bcrc32initialized) crc32_init(); crc = 0xffffffff; /* preload shift register, per CRC-32 spec */ for (p = buf; len > 0; ++p, --len) |