Quentin LAMBERT

Author's posts

drivers/ata: Move a dereference below a NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test is necessary, then the dereference should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ type T; expression E; identifier i,fld; statement S; @@ – T i = E->fld; + T i; … when != E when …

Continue reading

Input: use resource_size when allocating resources

Author: Julia Lawall <julia@diku.dk> Use the function resource_size, which reduces the chance of introducing off-by-one errors in calculating the resource size. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct resource *res; @@ – (res->end – res->start) + 1 + resource_size(res) // Signed-off-by: Julia Lawall Signed-off-by: Dmitry Torokhov — drivers/input/misc/cobalt_btns.c …

Continue reading

drivers/net/cs89x0.c: Avoid using magic number in set_dma_mode

Author: Julia Lawall <julia@diku.dk> The constant DMA_RX_MODE is defined to be 0x14 in the local include file cs89x0.h. Since a constant with the same name is used elsewhere with set_dma_mode, it seems likely that this constant could be used here. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E1; …

Continue reading

i2c: Use resource_size

Author: Julia Lawall <julia@diku.dk> Use the function resource_size, which reduces the chance of introducing off-by-one errors in calculating the resource size. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct resource *res; @@ – (res->end – res->start) + 1 + resource_size(res) // Signed-off-by: Julia Lawall Signed-off-by: Ben Dooks — drivers/i2c/busses/i2c-davinci.c …

Continue reading

drivers/net/smsc911x.c: Fix resource size off by 1 error

Author: Julia Lawall <julia@diku.dk> The call resource_size(res) returns res->end – res->start + 1 and thus the second change is semantics-preserving. res_size is then used as the second argument of a call to request_mem_region, and the memory allocated by this call appears to be the same as what is released in the two calls to release_mem_region. …

Continue reading

mtd: Use BLOCK_NIL consistently in NFTL/INFTL

Author: Julia Lawall <julia@diku.dk> Use BLOCK_NIL consistently rather than sometimes 0xffff and sometimes BLOCK_NIL. The semantic patch that finds this issue is below (http://www.emn.fr/x-info/coccinelle/). On the other hand, the changes were made by hand, in part because drivers/mtd/inftlcore.c contains dead code that causes spatch to ignore a relevant function. Specifically, the function INFTL_findwriteunit contains a …

Continue reading

Staging: rtl8192su: Correct use of ! and &

Author: Julia Lawall <julia@diku.dk> Correct priority problem in the use of ! and &. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; constant C; @@ – !E & C + !(E & C) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c | 2 +- 1 file changed, …

Continue reading

Staging: cpc-usb: Adjust NULL test

Author: Julia Lawall <julia@diku.dk> Since card must already be non-NULL, it seems that what was intended was to test the result of kmalloc. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E,E1; identifier f,fld,fld1; statement S1,S2; @@ E->fld = f(…); … when != E = E1 when != E->fld1 …

Continue reading

sound: use dev_set_drvdata

Author: Julia Lawall <julia@diku.dk> Eliminate direct accesses to the driver_data field. cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015 The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct device *dev; expression E; type T; @@ – dev->driver_data = (T)E + dev_set_drvdata(dev, E) @@ struct device *dev; type T; @@ – (T)dev->driver_data + dev_get_drvdata(dev) // Signed-off-by: Julia …

Continue reading

drivers/net: use dev_get_drvdata

Author: Julia Lawall <julia@diku.dk> Eliminate direct accesses to the driver_data field. cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015 The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ struct device *dev; expression E; type T; @@ – dev->driver_data = (T)E + dev_set_drvdata(dev, E) @@ struct device *dev; type T; @@ – (T)dev->driver_data + dev_get_drvdata(dev) // Signed-off-by: Julia …

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.