Category: Coccinelle

V4L/DVB (7591): drivers/media/video: use time_before, time_before_eq, etc

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) …

Continue reading

[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; …

Continue reading

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 …

Continue reading

[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 = …

Continue reading

[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 — …

Continue reading

[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 — …

Continue reading

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 | …

Continue reading

[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 …

Continue reading

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 | …

Continue reading

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 …

Continue reading

BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.