aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-02-17 21:42:53 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-17 21:42:53 -0500
commitd6584f3a08055688b2344eb26379fb2f3147ce91 (patch)
treef934b427af15b1ea532d333427c905207be7f129
parent163e3cb7daa8c3a6dde6a13a3d09a198930c6822 (diff)
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/) // <smpl> @ 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); ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/9p/trans_virtio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 0117b9fb8480..9e3d81cb9f08 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,
183 sg_set_buf(&sg[index++], data, s); 183 sg_set_buf(&sg[index++], data, s);
184 count -= s; 184 count -= s;
185 data += s; 185 data += s;
186 if (index > limit) 186 BUG_ON(index > limit);
187 BUG();
188 } 187 }
189 188
190 return index-start; 189 return index-start;