Author: Joe Perches <joe@perches.com> « foo = &function » is more commonly written « foo = function » Done with coccinelle script: // @r@ identifier f; @@ f(…) { … } @@ identifier r.f; @@ – &f + f // drivers/net/tehuti.c used a function and struct with the same name, the function was renamed. Compile tested x86 only. Signed-off-by: …
Catégorie : Linux
Aug 23 2010
arch/mn10300/mm: eliminate NULL dereference
Author: Julia Lawall <julia@diku.dk> dev_name always dereferences its argument, so it should not be called if the argument is NULL. The function indeed later tests the argument for being NULL. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression dev,E; @@ *dev_name(dev) … when != dev = E ( *dev …
Aug 16 2010
V4L/DVB: drivers/media/video: Use available error codes
Author: Julia Lawall <julia@diku.dk> Error codes are stored in rc, but the return value is always 0. Return rc instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return ; | return …
Aug 16 2010
drivers/net/wireless/wl12xx: Use available error codes
Author: Julia Lawall <julia@diku.dk> Error codes are stored in ret, but the return value is always 0. Return ret instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return ; | return …
Aug 16 2010
staging: Use available error codes
Author: Julia Lawall <julia@diku.dk> An error code is stored in a variable, but 0 is returned instead. Use the variable instead of 0. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return …
Aug 16 2010
V4L/DVB: drivers/media: Use available error codes
Author: Julia Lawall <julia@diku.dk> In each case, error codes are stored in rc, but the return value is always 0. Return rc instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return …
Aug 16 2010
V4L/DVB: drivers/media/video/zoran: Use available error codes
Author: Julia Lawall <julia@diku.dk> Error codes are stored in res, but the return value is always 0. Return res instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return ; | return …
Aug 16 2010
drivers/net/wireless/wl12xx: Use available error codes
Author: Julia Lawall <julia@diku.dk> In each case, error codes are stored in ret, but the return value is always 0. Return ret instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return …
Aug 16 2010
drivers/net/qlcnic: Use available error codes
Author: Julia Lawall <julia@diku.dk> The error code is stored in the variable err, but it is the variable ret that is returned instead. So store the error code in ret. Err is then useless. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) …
Aug 16 2010
net/ax25: Use available error codes
Author: Julia Lawall <julia@diku.dk> Error codes are stored in err, but the return value is always 0. Return err instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (…) { … x = -C … when != x ( return ; | return …