From: Himangi Saraogi Date: Fri, 8 Aug 2014 21:22:44 +0000 (-0700) Subject: kfifo: use BUG_ON X-Git-Tag: v3.17-rc1~73^2~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89b3ac63013e64621369f619fe732b629879c671;p=thirdparty%2Fkernel%2Flinux.git kfifo: use BUG_ON Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: // @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall Cc: Stefani Seibold Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/kfifo.c b/lib/kfifo.c index d79b9d222065b..90ba1eb1df06e 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);