]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.8.5/drivers-net-ethernet-sfc-ptp.c-adjust-duplicate-test.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.8.5 / drivers-net-ethernet-sfc-ptp.c-adjust-duplicate-test.patch
CommitLineData
d6e9c606
GKH
1From 1341f0cf6c27b37c1d67a1a4990883760667efbe Mon Sep 17 00:00:00 2001
2From: Julia Lawall <Julia.Lawall@lip6.fr>
3Date: Mon, 21 Jan 2013 03:02:48 +0000
4Subject: drivers/net/ethernet/sfc/ptp.c: adjust duplicate test
5
6
7From: Julia Lawall <Julia.Lawall@lip6.fr>
8
9[ Upstream commit 56567c6f8751c633581ca7c8e1cf08eed503f5ea ]
10
11Delete successive tests to the same location. rc was previously tested and
12not subsequently updated. efx_phc_adjtime can return an error code, so the
13call is updated so that is tested instead.
14
15A simplified version of the semantic match that finds this problem is as
16follows: (http://coccinelle.lip6.fr/)
17
18// <smpl>
19@s exists@
20local idexpression y;
21expression x,e;
22@@
23
24*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
25 { ... when forall
26 return ...; }
27... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
28 when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
29*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
30 { ... when forall
31 return ...; }
32// </smpl>
33
34Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
35Acked-by: Ben Hutchings <bhutchings@solarflare.com>
36Signed-off-by: David S. Miller <davem@davemloft.net>
37Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38---
39 drivers/net/ethernet/sfc/ptp.c | 2 +-
40 1 file changed, 1 insertion(+), 1 deletion(-)
41
42--- a/drivers/net/ethernet/sfc/ptp.c
43+++ b/drivers/net/ethernet/sfc/ptp.c
44@@ -1439,7 +1439,7 @@ static int efx_phc_settime(struct ptp_cl
45
46 delta = timespec_sub(*e_ts, time_now);
47
48- efx_phc_adjtime(ptp, timespec_to_ns(&delta));
49+ rc = efx_phc_adjtime(ptp, timespec_to_ns(&delta));
50 if (rc != 0)
51 return rc;
52