From: Julia Lawall Date: Mon, 27 Jul 2009 18:38:52 +0000 (-0700) Subject: drivers/atm: Correct redundant test X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6cf5767c7107c606644503f3e95bc1855386a70f;p=linux-beck.git 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/) // @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 ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 9359613addc5..307321b32cb3 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -372,7 +372,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb } snr = next_string(skb); - if (!str) + if (!snr) return -EIO; attn = next_string(skb); if (!attn)