Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6584f3a authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 163e3cb7
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -183,8 +183,7 @@ pack_sg_list(struct scatterlist *sg, int start, int limit, char *data,
		sg_set_buf(&sg[index++], data, s);
		sg_set_buf(&sg[index++], data, s);
		count -= s;
		count -= s;
		data += s;
		data += s;
		if (index > limit)
		BUG_ON(index > limit);
			BUG();
	}
	}


	return index-start;
	return index-start;