* Re: [PATCH 6/15] drivers/net/wireless/iwlegacy/4965-mac.c: adjust duplicate test
2013-01-21 13:02 ` [PATCH 6/15] drivers/net/wireless/iwlegacy/4965-mac.c: adjust duplicate test Julia Lawall
@ 2013-01-21 12:07 ` Stanislaw Gruszka
0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2013-01-21 12:07 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, John W. Linville, linux-wireless, netdev,
linux-kernel
On Mon, Jan 21, 2013 at 02:02:50PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Delete successive tests to the same location. This looks like simple code
> duplication.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @s exists@
> local idexpression y;
> expression x,e;
> @@
>
> *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
> { ... when forall
> return ...; }
> ... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
> when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
> *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
> { ... when forall
> return ...; }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
ACK
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 6/15] drivers/net/wireless/iwlegacy/4965-mac.c: adjust duplicate test
[not found] <1358773378-4700-1-git-send-email-Julia.Lawall@lip6.fr>
@ 2013-01-21 13:02 ` Julia Lawall
2013-01-21 12:07 ` Stanislaw Gruszka
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2013-01-21 13:02 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: kernel-janitors, John W. Linville, linux-wireless, netdev,
linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Delete successive tests to the same location. This looks like simple code
duplication.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 10fc249..0195190 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6572,9 +6572,6 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto out_free_eeprom;
- if (err)
- goto out_free_eeprom;
-
/* extract MAC Address */
il4965_eeprom_get_mac(il, il->addresses[0].addr);
D_INFO("MAC address: %pM\n", il->addresses[0].addr);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-21 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1358773378-4700-1-git-send-email-Julia.Lawall@lip6.fr>
2013-01-21 13:02 ` [PATCH 6/15] drivers/net/wireless/iwlegacy/4965-mac.c: adjust duplicate test Julia Lawall
2013-01-21 12:07 ` Stanislaw Gruszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).