From: Julia Lawall Date: Mon, 18 Feb 2008 02:42:53 +0000 (-0800) Subject: net/9p/trans_virtio.c: Use BUG_ON X-Git-Tag: v2.6.25-rc3~9^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6584f3a08055688b2344eb26379fb2f3147ce91;p=platform%2Fkernel%2Flinux-exynos.git net/9p/trans_virtio.c: Use BUG_ON if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @ disable unlikely @ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 0117b9f..9e3d81c 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -183,8 +183,7 @@ pack_sg_list(struct scatterlist *sg, int start, int limit, char *data, sg_set_buf(&sg[index++], data, s); count -= s; data += s; - if (index > limit) - BUG(); + BUG_ON(index > limit); } return index-start;