Commit 6cf5767c authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

drivers/atm: Correct redundant test

str has already been tested.  It seems that this test should be on the
recently returned value snr.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
expression E;
@@

if (x == NULL || ...) { ... when forall
   return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
*x == NULL
|
*x != NULL
)
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a44a4a00
...@@ -372,7 +372,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb ...@@ -372,7 +372,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
} }
snr = next_string(skb); snr = next_string(skb);
if (!str) if (!snr)
return -EIO; return -EIO;
attn = next_string(skb); attn = next_string(skb);
if (!attn) if (!attn)
......
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