Author: Julia Lawall <julia@diku.dk> The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. A simplified version of the semantic patch making this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @ change_compare_np @ expression E; @@ ( – jiffies = E + time_after_eq(jiffies,E) | – jiffies < E + time_before(jiffies,E) …
Mar 28 2008
[POWERPC] Use FIELD_SIZEOF in drivers/block/viodasd.c
Author: Julia Lawall <julia@diku.dk> Robert P.J. Day proposed to use the macro FIELD_SIZEOF in replace of code that matches its definition. The modification was made using the following semantic patch (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #include @depends on haskernel@ type t; identifier f; @@ – (sizeof(((t*)0)->f)) + FIELD_SIZEOF(t, f) @depends on haskernel@ type t; identifier f; …
Mar 27 2008
ACPI: drivers/acpi: elide a non-zero test on a result that is never 0
Author: Julia Lawall <julia@diku.dk> The function thermal_cooling_device_register always returns either a valid pointer or a value made with ERR_PTR, so a test for non-zero on the result will always succeed. The problem was found using the following semantic match. (http://www.emn.fr/x-info/coccinelle/) // @a@ expression E, E1; statement S,S1; position p; @@ E = thermal_cooling_device_register(…) … when …
Mar 24 2008
[GFS2] test for IS_ERR rather than 0
Author: Julia Lawall <julia@diku.dk> The function gfs2_inode_lookup always returns either a valid pointer or a value made with ERR_PTR, so its result should be tested with IS_ERR, not with a test for 0. The problem was found using the following semantic match. (http://www.emn.fr/x-info/coccinelle/) // @a@ expression E, E1; statement S,S1; position p; @@ E = …
Mar 23 2008
[9P] net/9p/trans_fd.c: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable cb is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — net/9p/trans_fd.c | 2 — …
Mar 23 2008
[IPV6] net/ipv6/ndisc.c: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable hlen is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — net/ipv6/ndisc.c | 2 — …
Mar 17 2008
ixgb: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable num_group_tail_writes is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Signed-off-by: Auke Kok Signed-off-by: Jeff Garzik — drivers/net/ixgb/ixgb_main.c | …
Mar 17 2008
[ALSA] sound/pci: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable is_capture is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai — sound/pci/pcxhr/pcxhr.c | 3 — 1 …
Mar 15 2008
drivers/net/atl1/atl1_main.c: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable update_rx is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Acked-by: Jay Cliburn Signed-off-by: Jeff Garzik — drivers/net/atl1/atl1_main.c | …
Mar 15 2008
drivers/net/ipg.c: remove unused variable
Author: Julia Lawall <julia@diku.dk> The variable gig is initialized but never used otherwise. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; identifier i; constant C; @@ ( extern T i; | – T i; ) // Signed-off-by: Julia Lawall Signed-off-by: Jeff Garzik — drivers/net/ipg.c | 3 — 1 …