]>
Commit | Line | Data |
---|---|---|
d6e9c606 GKH |
1 | From 1341f0cf6c27b37c1d67a1a4990883760667efbe Mon Sep 17 00:00:00 2001 |
2 | From: Julia Lawall <Julia.Lawall@lip6.fr> | |
3 | Date: Mon, 21 Jan 2013 03:02:48 +0000 | |
4 | Subject: drivers/net/ethernet/sfc/ptp.c: adjust duplicate test | |
5 | ||
6 | ||
7 | From: Julia Lawall <Julia.Lawall@lip6.fr> | |
8 | ||
9 | [ Upstream commit 56567c6f8751c633581ca7c8e1cf08eed503f5ea ] | |
10 | ||
11 | Delete successive tests to the same location. rc was previously tested and | |
12 | not subsequently updated. efx_phc_adjtime can return an error code, so the | |
13 | call is updated so that is tested instead. | |
14 | ||
15 | A simplified version of the semantic match that finds this problem is as | |
16 | follows: (http://coccinelle.lip6.fr/) | |
17 | ||
18 | // <smpl> | |
19 | @s exists@ | |
20 | local idexpression y; | |
21 | expression 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 | ||
34 | Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> | |
35 | Acked-by: Ben Hutchings <bhutchings@solarflare.com> | |
36 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
37 | Signed-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 |