]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/net/ethernet/sfc/ptp.c: adjust duplicate test
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 21 Jan 2013 03:02:48 +0000 (03:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:17:24 +0000 (12:17 -0700)
commitaa94bf27d464126a42212d486211946f93d21b00
tree992d76b414af110bf8a3e50a9cdc446ec13683c8
parent95c4d95b1db2bfa42759ecb2000395a68a150bb0
drivers/net/ethernet/sfc/ptp.c: adjust duplicate test

[ Upstream commit 56567c6f8751c633581ca7c8e1cf08eed503f5ea ]

Delete successive tests to the same location.  rc was previously tested and
not subsequently updated.  efx_phc_adjtime can return an error code, so the
call is updated so that is tested instead.

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>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/sfc/ptp.c