Author: Julia Lawall <julia@diku.dk> list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x; statement S,S1,S2; @@ I(x,…) { } // Signed-off-by: Julia Lawall Acked-by: Alexander …
Category: Coccinelle
Aug 04 2010
staging: Drop unnecessary null test
Author: Julia Lawall <julia@diku.dk> list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x; statement S; @@ I(x,…) { } // Signed-off-by: Julia Lawall Signed-off-by: Greg …
Aug 04 2010
fs/dlm: Drop unnecessary null test
Author: Julia Lawall <julia@diku.dk> hlist_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E,E1,E2; statement S,S1,S2; @@ I(x,…) { } // Signed-off-by: Julia Lawall Signed-off-by: David …
Aug 03 2010
powerpc/pci: Drop unnecessary null test
Author: Julia Lawall <julia@diku.dk> list_for_each_entry binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E,E1,E2; statement S,S1,S2; @@ I(x,…) { } // Signed-off-by: Julia Lawall Signed-off-by: Benjamin …
Aug 03 2010
powerpc/powermac: Drop unnecessary null test
Author: Julia Lawall <julia@diku.dk> for_each_node_by_name binds its first argument to a non-null value, and thus any null test on the value of that argument is superfluous. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator I; expression x,E; @@ I(x,…) { } // Signed-off-by: Julia Lawall Signed-off-by: Benjamin Herrenschmidt — …
Aug 03 2010
powerpc/powermac: Drop unnecessary of_node_put
Author: Julia Lawall <julia@diku.dk> for_each_node_by_name only exits when its first argument is NULL, and a subsequent call to of_node_put on that argument is unnecessary. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ iterator name for_each_node_by_name; expression np,E; identifier l; @@ for_each_node_by_name(np,…) { … when != break; when != goto l; …
Aug 03 2010
arch/sparc/mm: Use GFP_KERNEL
Author: Julia Lawall <julia@diku.dk> GFP_ATOMIC is not needed here, as evidenced by the other two uses of GFP_KERNEL in the same function. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier f; @@ *f(…,GFP_ATOMIC,…) … when != spin_unlock(…) when != read_unlock(…) when != write_unlock(…) when != read_unlock_irq(…) when != write_unlock_irq(…) …
Aug 01 2010
[SCSI] pm8001: 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; expression E; identifier f,f1; position p1,p2; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); f1 = E | (x->f1 == NULL || …) | f(…,x->f1,…) ) …> …
Jul 31 2010
net/rose: Use GFP_ATOMIC
Author: Julia Lawall <julia@diku.dk> The other calls to kmalloc in the same function use GFP_ATOMIC, and indeed two locks are held within the body of the function. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier f; @@ *f(…,GFP_ATOMIC,…) … when != spin_unlock(…) when != read_unlock(…) when != write_unlock(…) when …
Jul 30 2010
SA1111: Eliminate use after free
Author: Julia Lawall <julia@diku.dk> __sa1111_remove always frees its argument, so the subsequent reference to sachip->saved_state represents a use after free. __sa1111_remove does not appear to use the saved_state field, so the patch simply frees it first. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E,E2; …