Articles de cet auteur
Nov 09 2008
drivers/net/wireless/ath9k/rc.c: use ARRAY_SIZE
Author: Julia Lawall <julia@diku.dk> ARRAY_SIZE is more concise to use when the size of an array is divided by the size of its type or the size of its first element. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @i@ @@ #include @depends on i using « paren.iso »@ type T; T[] E; …
Oct 30 2008
i2c-s3c2410: Correct use of ! and &
Author: Julia Lawall <julia@diku.dk> In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that involved converting !x & y to !(x & y). The code below shows the same pattern, and thus should perhaps be fixed in the same way. In particular, the result of !readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN is always 0. The semantic patch that …
Oct 23 2008
PCI hotplug: fix logic in Compaq hotplug controller bus speed setup
Author: Julia Lawall <julia@diku.dk> The pattern !E && !E->fld is nonsensical. The patch below updates this according to the assumption that && should be ||. But perhaps another solution was intended. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @disable and_comm@ expression E; identifier fld; @@ – !E && !E->fld + …
Oct 16 2008
fuse: add missing fuse_request_free
Author: Julia Lawall <julia@diku.dk> The error handling code for the second call to fuse_request_alloc should include freeing the result of the first one. This bug was found by the Coccinelle project: http://www.emn.fr/x-info/coccinelle/ Signed-off-by: Julia Lawall Signed-off-by: Miklos Szeredi — fs/fuse/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff –git a/fs/fuse/inode.c b/fs/fuse/inode.c …
Oct 16 2008
drivers/net/xen-netfront.c: Use DIV_ROUND_UP
Author: Julia Lawall <julia@diku.dk> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #include @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / …
Oct 16 2008
fs/reiserfs: use an IS_ERR test rather than a NULL test
Author: Julien Brunel <brunel@diku.dk> In case of error, the function open_xa_dir returns an ERR pointer, but never returns a NULL pointer. So a NULL test that comes after an IS_ERR test should be deleted. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @match_bad_null_test@ expression x, E; statement S1,S2; @@ x = …
Oct 16 2008
drivers/misc: Use DIV_ROUND_UP
Author: Julia Lawall <julia@diku.dk> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) – 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @haskernel@ @@ #include @depends on haskernel@ expression n,d; @@ ( – (n + d – 1) / …
Oct 15 2008
FRV: Eliminate NULL test and memset after alloc_bootmem
Author: Julia Lawall <julia@diku.dk> As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b, alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. arch/frv/mm/init.c | 2 — 1 file changed, 2 deletions(-) This was fixed using the following …
Oct 14 2008
[SCSI] sun3x_esp: Convert && to ||
Author: Julia Lawall <julia@diku.dk> The pattern !E && !E->fld is nonsensical. The patch below updates this according to the assumption that && should be ||. But perhaps another solution was intended. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @disable and_comm@ expression E; identifier fld; @@ – !E && !E->fld + …
Oct 13 2008
arch/m68k/mm/kmap.c: introduce missing kfree
Author: Julia Lawall <julia@diku.dk> Error handling code following a kmalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…)) == NULL) S | x@p1 …