Commit 5c7d08c3 authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman

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: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6955a8f
...@@ -153,7 +153,7 @@ static u32 getcrc32(u8 *buf, u32 len) ...@@ -153,7 +153,7 @@ static u32 getcrc32(u8 *buf, u32 len)
u8 *p; u8 *p;
u32 crc; u32 crc;
if (bcrc32initialized == 0) if (!bcrc32initialized)
crc32_init(); crc32_init();
crc = 0xffffffff; /* preload shift register, per CRC-32 spec */ crc = 0xffffffff; /* preload shift register, per CRC-32 spec */
for (p = buf; len > 0; ++p, --len) for (p = buf; len > 0; ++p, --len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment