The patch titled Subject: kfifo: use BUG_ON has been added to the -mm tree. Its filename is kfifo-use-bug_on.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/kfifo-use-bug_on.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/kfifo-use-bug_on.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Himangi Saraogi <himangi774@xxxxxxxxx> Subject: 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@xxxxxxxxx> Acked-by: Julia Lawall <julia.lawall@xxxxxxx> Cc: Stefani Seibold <stefani@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/kfifo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff -puN lib/kfifo.c~kfifo-use-bug_on lib/kfifo.c --- a/lib/kfifo.c~kfifo-use-bug_on +++ a/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); _ Patches currently in -mm which might be from himangi774@xxxxxxxxx are kfifo-use-bug_on.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html