All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefani Seibold <stefani@seibold.net>
To: Andrea Righi <arighi@develer.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	trivial@kernel.org, kernel-janitors@vger.kernel.org,
	Stefani Seibold <stefani@seibold.net>,
	"Ira W. Snyder" <iws@ovro.caltech.edu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/11] kernel/kfifo.c: trivial: use BUG_ON
Date: Wed, 03 Aug 2011 06:30:40 +0000	[thread overview]
Message-ID: <1312353040.30326.0.camel@wall-e> (raw)
In-Reply-To: <Pine.LNX.4.64.1108021349330.24349@ask.diku.dk>

From: Julia Lawall <julia@diku.dk>

Allow the function to return 0 when 0 elements are asked for rather than
crashing the kernel with BUG.

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Stefano Seibold <stefani@seibold.net>

---
 var/julia/linuxcopy/kernel/kfifo.c |    6 ------
 1 file changed, 6 deletions(-)

diff -u -p a/kernel/kfifo.c b/kernel/kfifo.c
index 01a0700..9f928ef 100644
--- a/var/linuxes/linux-next/kernel/kfifo.c
+++ b/var/julia/linuxcopy/kernel/kfifo.c
@@ -562,9 +562,6 @@ 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();
-
 	len = __kfifo_max_r(len, recsize);
 
 	if (len + recsize > kfifo_unused(fifo))
@@ -586,9 +583,6 @@ 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();
-
 	len = __kfifo_max_r(len, recsize);
 
 	if (len + recsize > fifo->in - fifo->out)



WARNING: multiple messages have this Message-ID (diff)
From: Stefani Seibold <stefani@seibold.net>
To: Andrea Righi <arighi@develer.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	trivial@kernel.org, kernel-janitors@vger.kernel.org,
	Stefani Seibold <stefani@seibold.net>,
	"Ira W. Snyder" <iws@ovro.caltech.edu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/11] kernel/kfifo.c: trivial: use BUG_ON
Date: Wed, 03 Aug 2011 08:30:40 +0200	[thread overview]
Message-ID: <1312353040.30326.0.camel@wall-e> (raw)
In-Reply-To: <Pine.LNX.4.64.1108021349330.24349@ask.diku.dk>

From: Julia Lawall <julia@diku.dk>

Allow the function to return 0 when 0 elements are asked for rather than
crashing the kernel with BUG.

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Stefano Seibold <stefani@seibold.net>

---
 var/julia/linuxcopy/kernel/kfifo.c |    6 ------
 1 file changed, 6 deletions(-)

diff -u -p a/kernel/kfifo.c b/kernel/kfifo.c
index 01a0700..9f928ef 100644
--- a/var/linuxes/linux-next/kernel/kfifo.c
+++ b/var/julia/linuxcopy/kernel/kfifo.c
@@ -562,9 +562,6 @@ 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();
-
 	len = __kfifo_max_r(len, recsize);
 
 	if (len + recsize > kfifo_unused(fifo))
@@ -586,9 +583,6 @@ 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();
-
 	len = __kfifo_max_r(len, recsize);
 
 	if (len + recsize > fifo->in - fifo->out)



  parent reply	other threads:[~2011-08-03  6:30 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 10:34 [PATCH 0/11] trivial: use BUG_ON Julia Lawall
2011-08-02 10:34 ` Julia Lawall
2011-08-02 10:34 ` [PATCH 1/11] kernel/kfifo.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 11:33   ` Andrea Righi
2011-08-02 11:33     ` Andrea Righi
2011-08-02 11:52     ` Julia Lawall
2011-08-02 11:52       ` Julia Lawall
2011-08-02 12:03       ` Andrea Righi
2011-08-02 12:03         ` Andrea Righi
2011-08-02 15:20         ` Julia Lawall
2011-08-02 15:20           ` Julia Lawall
2011-08-02 19:27       ` Julia Lawall
2011-08-02 19:27         ` Julia Lawall
2011-08-02 20:09         ` Andrea Righi
2011-08-02 20:09           ` Andrea Righi
2011-08-03  6:30       ` Stefani Seibold [this message]
2011-08-03  6:30         ` Stefani Seibold
2011-08-02 10:34 ` [PATCH 2/11] drivers/message/fusion/mptsas.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-04  6:54   ` [PATCH 2/11] drivers/message/fusion/mptsas.c: trivial: use Nandigama, Nagalakshmi
2011-08-04  6:54     ` [PATCH 2/11] drivers/message/fusion/mptsas.c: trivial: use BUG_ON Nandigama, Nagalakshmi
2011-08-04  7:13   ` walter harms
2011-08-02 10:34 ` [PATCH 3/11] arch/arm/mach-s3c64xx/dma.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 10:34 ` [PATCH 4/11] arch/x86/kvm/vmx.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 16:44   ` Marcelo Tosatti
2011-08-02 16:44     ` Marcelo Tosatti
2011-08-02 10:34 ` [PATCH 5/11] kernel/sysctl.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 10:34 ` [PATCH 6/11] drivers/iommu/iommu.c: " Julia Lawall
2011-08-02 10:34   ` Julia Lawall
2011-08-02 10:35 ` [PATCH 7/11] arch/m32r/kernel/smp.c: " Julia Lawall
2011-08-02 10:35   ` Julia Lawall
2011-08-02 10:55   ` KOSAKI Motohiro
2011-08-02 10:55     ` KOSAKI Motohiro
2011-08-02 10:35 ` [PATCH 8/11] fs/btrfs/volumes.c: " Julia Lawall
2011-08-02 10:35   ` Julia Lawall
2011-08-02 10:35 ` [PATCH 9/11] drivers/target/target_core_rd.c: " Julia Lawall
2011-08-02 10:35   ` Julia Lawall
2011-08-04 18:05   ` [PATCH 9/11] drivers/target/target_core_rd.c: trivial: use Nicholas A. Bellinger
2011-08-04 18:05     ` [PATCH 9/11] drivers/target/target_core_rd.c: trivial: use BUG_ON Nicholas A. Bellinger
2011-08-02 10:35 ` [PATCH 10/11] arch/openrisc/mm/init.c: " Julia Lawall
2011-08-02 10:35   ` Julia Lawall
2011-08-02 13:55   ` Jonas Bonn
2011-08-02 13:55     ` Jonas Bonn
2011-08-02 10:35 ` [PATCH 11/11] arch/tile/mm/init.c: " Julia Lawall
2011-08-02 10:35   ` Julia Lawall
2011-08-02 20:28   ` Chris Metcalf
2011-08-02 20:28     ` Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312353040.30326.0.camel@wall-e \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=arighi@develer.com \
    --cc=iws@ovro.caltech.edu \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.