summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ptp.c
diff options
context:
space:
mode:
authorJulia Lawall2013-01-21 04:02:48 +0100
committerDavid S. Miller2013-01-21 21:44:58 +0100
commit56567c6f8751c633581ca7c8e1cf08eed503f5ea (patch)
treeed95b14cd626f67ebea161f7fd8b8a2692745915 /drivers/net/ethernet/sfc/ptp.c
parentndisc: Do not try to update "updated" time if neighbour has already gone. (diff)
downloadkernel-qcow2-linux-56567c6f8751c633581ca7c8e1cf08eed503f5ea.tar.gz
kernel-qcow2-linux-56567c6f8751c633581ca7c8e1cf08eed503f5ea.tar.xz
kernel-qcow2-linux-56567c6f8751c633581ca7c8e1cf08eed503f5ea.zip
drivers/net/ethernet/sfc/ptp.c: adjust duplicate test
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>
Diffstat (limited to 'drivers/net/ethernet/sfc/ptp.c')
-rw-r--r--drivers/net/ethernet/sfc/ptp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 0767043f44a4..3f93624fc273 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1439,7 +1439,7 @@ static int efx_phc_settime(struct ptp_clock_info *ptp,
delta = timespec_sub(*e_ts, time_now);
- efx_phc_adjtime(ptp, timespec_to_ns(&delta));
+ rc = efx_phc_adjtime(ptp, timespec_to_ns(&delta));
if (rc != 0)
return rc;