Author: Julia Lawall <julia@diku.dk> Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // Signed-off-by: Julia Lawall Signed-off-by: Nicholas Bellinger — drivers/target/target_core_rd.c | 24 ++++++++—————- 1 file changed, 8 insertions(+), …
Aug 02 2011
KVM: VMX: trivial: use BUG_ON
Author: Julia Lawall <julia@diku.dk> Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // Signed-off-by: Julia Lawall Signed-off-by: Marcelo Tosatti — arch/x86/kvm/vmx.c | 3 +– 1 file changed, 1 insertion(+), …
Aug 02 2011
target: Use ERR_CAST inlined function
Author: Thomas Meyer <thomas@m3y3r.de> Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(…)) The semantic patch that makes this output is available in scripts/coccinelle/api/err_cast.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer Signed-off-by: Nicholas Bellinger — drivers/target/iscsi/iscsi_target_configfs.c | 4 ++– drivers/target/target_core_fabric_configfs.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff …
Jul 29 2011
frv: remove unnecessary code
Author: Greg Dietsche <Gregory.Dietsche@cuw.edu> remove unnecessary code that matches this coccinelle pattern if (…) return ret; return ret; Signed-off-by: Greg Dietsche Signed-off-by: David Howells Signed-off-by: Linus Torvalds — arch/frv/mm/pgalloc.c | 8 +——- 1 file changed, 1 insertion(+), 7 deletions(-) diff –git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c index c42c83d..4fb63a3 100644 — a/arch/frv/mm/pgalloc.c +++ b/arch/frv/mm/pgalloc.c @@ -133,13 +133,7 @@ …
Jul 28 2011
ALSA: sound/core/pcm_compat.c: adjust array index
Author: Julia Lawall <julia@diku.dk> Convert array index from the loop bound to the loop index. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,ar; @@ for(e1 = 0; e1 < e2; e1++) { } // Signed-off-by: Julia Lawall Cc: Signed-off-by: Takashi Iwai --- sound/core/pcm_compat.c | …
Jul 28 2011
drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c: adjust array index
Author: Julia Lawall <julia@diku.dk> Convert array index from the loop bound to the loop index. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,ar; @@ for(e1 = 0; e1 < e2; e1++) { } // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c | 2 …
Jul 28 2011
drivers/net/niu.c: adjust array index
Author: Julia Lawall <julia@diku.dk> Convert array index from the loop bound to the loop index. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,ar; @@ for(e1 = 0; e1 < e2; e1++) { } // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- drivers/net/niu.c | …
Jul 28 2011
net: adjust array index
Author: Julia Lawall <julia@diku.dk> Convert array index from the loop bound to the loop index. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,ar; @@ for(e1 = 0; e1 < e2; e1++) { } // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- net/ipv4/igmp.c | …
Jul 12 2011
[SCSI] ipr: reorder error handling code to include iounmap
Author: Julia Lawall <julia@diku.dk> The out_msi_disable label should be before cleanup_nomem to additionally benefit from the call to iounmap. Subsequent gotos are adjusted to go to out_msi_disable instead of cleanup_nomem, which now follows it. This is safe because pci_disable_msi does nothing if pci_enable_msi was not called. A simplified version of the semantic match that finds …
Jul 09 2011
drivers/staging/hv/blkvsc_drv.c: eliminate NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> In this code, blkvsc_req is allocated in the cache blkdev->request_pool, but freed in the first case to the cache blkvsc_req->dev->request_pool. blkvsc_req->dev is subsequently initialized to blkdev, making these the same at the second call to kmem_cache_free. But at the point of the first call, blkvsc_req->dev is NULL. The second call is …