Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6584f3a08055688b2344eb26379fb2f3147ce91 Commit: d6584f3a08055688b2344eb26379fb2f3147ce91 Parent: 163e3cb7daa8c3a6dde6a13a3d09a198930c6822 Author: Julia Lawall <[EMAIL PROTECTED]> AuthorDate: Sun Feb 17 18:42:53 2008 -0800 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Sun Feb 17 18:42:53 2008 -0800
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 <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- net/9p/trans_virtio.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) 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; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html