Category: Linux

hlist: drop the node parameter from iterators

Author: Sasha Levin <sasha.levin@oracle.com> I’m not sure why, but the hlist for each entry iterators were conceived list_for_each_entry(pos, head, member) The hlist ones were greedy and wanted an extra parameter: hlist_for_each_entry(tpos, pos, head, member) Why did they need an extra pos parameter? I’m not quite sure. Not only they don’t really need it, it also …

Continue reading

memstick: move the dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Cc: Maxim Levitsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — drivers/memstick/host/r592.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)   diff –git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index 29b2172..a7c5b31 …

Continue reading

regulator: s5m8767: adjust duplicate test

Author: Julia Lawall <Julia.Lawall@lip6.fr> Delete successive tests to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @s exists@ local idexpression y; expression x,e; @@ *if ( \(x == NULL\|IS_ERR(x)\|y != 0\) ) { … when forall return …; } … when != \(y = …

Continue reading

drivers/rtc: remove unnecessary semicolons

Author: Peter Senna Tschudin <peter.senna@gmail.com> Found by Coccinelle: http://coccinelle.lip6.fr/ Signed-off-by: Peter Senna Tschudin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — drivers/rtc/rtc-isl12022.c | 2 +- drivers/rtc/rtc-pcf8563.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index 1850104..6b4298e 100644 — a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -227,7 +227,7 @@ static int isl12022_set_datetime(struct i2c_client …

Continue reading

configfs: move the dereference below the NULL test

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Cc: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — fs/configfs/dir.c | 5 +++– 1 file changed, 3 insertions(+), 2 deletions(-)   diff –git a/fs/configfs/dir.c b/fs/configfs/dir.c index 712b10f..e9dcfa3 …

Continue reading

ext4: use WARN in ext4_alloc_blocks

Author: Julia Lawall <Julia.Lawall@lip6.fr> Use WARN rather than printk followed by WARN_ON(1), for conciseness. A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ expression list es; @@ -printk( +WARN(1, es); -WARN_ON(1); // Signed-off-by: Julia Lawall Signed-off-by: “Theodore Ts’o” — fs/ext4/indirect.c | 3 +– 1 file changed, 1 …

Continue reading

staging/omapdrm: Use kmemdup rather than duplicating its implementation

Author: Peter Huewe <peterhuewe@gmx.de> Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman — drivers/staging/omapdrm/omap_gem.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c index 08f1e292..f9297eb 100644 — a/drivers/staging/omapdrm/omap_gem.c +++ b/drivers/staging/omapdrm/omap_gem.c @@ -1267,12 +1267,12 @@ …

Continue reading

staging/omapdrm: Use kmemdup rather than duplicating its implementation

Author: Peter Huewe <peterhuewe@gmx.de> Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman — drivers/staging/omapdrm/omap_gem.c | 4 ++– 1 file changed, 2 insertions(+), 2 deletions(-)   diff –git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c index 08f1e292..f9297eb 100644 — a/drivers/staging/omapdrm/omap_gem.c +++ b/drivers/staging/omapdrm/omap_gem.c @@ -1267,12 +1267,12 @@ …

Continue reading

staging/csr: Use kmemdup rather than duplicating its implementation

Author: Peter Huewe <peterhuewe@gmx.de> Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman — drivers/staging/csr/drv.c | 6 +++— 1 file changed, 3 insertions(+), 3 deletions(-)   diff –git a/drivers/staging/csr/drv.c b/drivers/staging/csr/drv.c index 4780c32..3bd52fd 100644 — a/drivers/staging/csr/drv.c +++ b/drivers/staging/csr/drv.c @@ -819,15 +819,15 @@ unifi_write(struct file *filp, …

Continue reading

[media] staging/media/go7007: Use kmemdup rather than duplicating its implementation

Author: Peter Huewe <PeterHuewe@gmx.de> Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe Signed-off-by: Mauro Carvalho Chehab — drivers/staging/media/go7007/go7007-driver.c | 3 +– 1 file changed, 1 insertion(+), 2 deletions(-)   diff –git a/drivers/staging/media/go7007/go7007-driver.c b/drivers/staging/media/go7007/go7007-driver.c index 0aaeb0a..6695091 100644 — a/drivers/staging/media/go7007/go7007-driver.c +++ b/drivers/staging/media/go7007/go7007-driver.c @@ -108,14 +108,13 @@ static int …

Continue reading