* [PATCH 1/12] drivers/atm: Correct redundant test
@ 2009-07-27 16:12 Julia Lawall
2009-07-27 18:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2009-07-27 16:12 UTC (permalink / raw)
To: chas, linux-atm-general, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
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: Julia Lawall <julia@diku.dk>
---
drivers/atm/solos-pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 9359613..307321b 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)
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 1/12] drivers/atm: Correct redundant test
2009-07-27 16:12 [PATCH 1/12] drivers/atm: Correct redundant test Julia Lawall
@ 2009-07-27 18:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-07-27 18:39 UTC (permalink / raw)
To: julia; +Cc: chas, linux-atm-general, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
Date: Mon, 27 Jul 2009 18:12:34 +0200 (CEST)
> From: Julia Lawall <julia@diku.dk>
>
> 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/)
...
> Signed-off-by: Julia Lawall <julia@diku.dk>
Applied, but as per the MAINTAINERS entry, please CC: ATM patches
to netdev@vger.kernel.org, thanks:
ATM
P: Chas Williams
M: chas@cmf.nrl.navy.mil
L: linux-atm-general@lists.sourceforge.net (subscribers-only)
L: netdev@vger.kernel.org
W: http://linux-atm.sourceforge.net
S: Maintained
F: drivers/atm/
F: include/linux/atm*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-27 18:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 16:12 [PATCH 1/12] drivers/atm: Correct redundant test Julia Lawall
2009-07-27 18:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®