Catégorie : Linux

drivers/net: Remove address use from assignments of function pointers

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

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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 …

Lire la suite

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

Lire la suite

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 …

Lire la suite