diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-08-08 14:22:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 15:57:25 -0700 |
commit | 89b3ac63013e64621369f619fe732b629879c671 (patch) | |
tree | 0f8c23eec330727b2208fe1b0965eb6de9a8cdbb /lib | |
parent | 998d6688fb399ab313dcd6f24d1196e3aaa8578c (diff) | |
download | op-kernel-dev-89b3ac63013e64621369f619fe732b629879c671.zip op-kernel-dev-89b3ac63013e64621369f619fe732b629879c671.tar.gz |
kfifo: use BUG_ON
Use BUG_ON(x) rather than if(x) BUG();
The semantic patch that fixes this problem is as follows:
// <smpl>
@@ identifier x; @@
-if (!x) BUG();
+BUG_ON(!x);
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Cc: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kfifo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/kfifo.c b/lib/kfifo.c index d79b9d2..90ba1eb 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c @@ -561,8 +561,7 @@ EXPORT_SYMBOL(__kfifo_to_user_r); unsigned int __kfifo_dma_in_prepare_r(struct __kfifo *fifo, struct scatterlist *sgl, int nents, unsigned int len, size_t recsize) { - if (!nents) - BUG(); + BUG_ON(!nents); len = __kfifo_max_r(len, recsize); @@ -585,8 +584,7 @@ EXPORT_SYMBOL(__kfifo_dma_in_finish_r); unsigned int __kfifo_dma_out_prepare_r(struct __kfifo *fifo, struct scatterlist *sgl, int nents, unsigned int len, size_t recsize) { - if (!nents) - BUG(); + BUG_ON(!nents); len = __kfifo_max_r(len, recsize); |