diff options
author | Julia Lawall <julia@diku.dk> | 2009-07-27 02:13:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-27 14:35:28 -0400 |
commit | 463889e27e6f4f097374a6c9de5611f520766dad (patch) | |
tree | 80c5d38c591e85fe004b571c84414d5603726b02 | |
parent | f004ec728bff3cf924ffc19387baca503cd73b01 (diff) |
drivers/net: Correct redundant test
res has already been tested. It seems that this test should be on the
recently returned value mmio.
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethoc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index ceb6a9c357ad..4dbe5f173273 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -894,7 +894,7 @@ static int ethoc_probe(struct platform_device *pdev) | |||
894 | 894 | ||
895 | mmio = devm_request_mem_region(&pdev->dev, res->start, | 895 | mmio = devm_request_mem_region(&pdev->dev, res->start, |
896 | res->end - res->start + 1, res->name); | 896 | res->end - res->start + 1, res->name); |
897 | if (!res) { | 897 | if (!mmio) { |
898 | dev_err(&pdev->dev, "cannot request I/O memory space\n"); | 898 | dev_err(&pdev->dev, "cannot request I/O memory space\n"); |
899 | ret = -ENXIO; | 899 | ret = -ENXIO; |
900 | goto free; | 900 | goto free; |