From: Eric Sesterhenn / snakebyte <snakebyte@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [Patch] BUG_ON() Conversion in drivers/block/
Date: Wed, 01 Feb 2006 00:27:56 +0000 [thread overview]
Message-ID: <1138753677.9742.10.camel@alice> (raw)
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
hi,
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.16-rc1-git4/drivers/block/cciss.c.orig 2006-01-31 21:31:55.000000000 +0100
+++ linux-2.6.16-rc1-git4/drivers/block/cciss.c 2006-01-31 21:32:10.000000000 +0100
@@ -2361,8 +2361,7 @@ queue:
if (!creq)
goto startio;
- if (creq->nr_phys_segments > MAXSGENTRIES)
- BUG();
+ BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);
if (( c = cmd_alloc(h, 1)) == NULL)
goto full;
--- linux-2.6.16-rc1-git4/drivers/block/cciss_scsi.c.orig 2006-01-31 21:27:30.000000000 +0100
+++ linux-2.6.16-rc1-git4/drivers/block/cciss_scsi.c 2006-01-31 21:27:58.000000000 +0100
@@ -1316,7 +1316,7 @@ cciss_scsi_queue_command (struct scsi_cm
cp->Request.Timeout = 0;
memset(cp->Request.CDB, 0, sizeof(cp->Request.CDB));
- if (cmd->cmd_len > sizeof(cp->Request.CDB)) BUG();
+ BUG_ON(cmd->cmd_len > sizeof(cp->Request.CDB));
cp->Request.CDBLen = cmd->cmd_len;
memcpy(cp->Request.CDB, cmd->cmnd, cmd->cmd_len);
cp->Request.Type.Type = TYPE_CMD;
--- linux-2.6.16-rc1-git4/drivers/block/cpqarray.c.orig 2006-01-31 21:32:23.000000000 +0100
+++ linux-2.6.16-rc1-git4/drivers/block/cpqarray.c 2006-01-31 21:32:33.000000000 +0100
@@ -910,8 +910,7 @@ queue_next:
if (!creq)
goto startio;
- if (creq->nr_phys_segments > SG_MAX)
- BUG();
+ BUG_ON(creq->nr_phys_segments > SG_MAX);
if ((c = cmd_alloc(h,1)) == NULL)
goto startio;
--- linux-2.6.16-rc1-git4/drivers/block/DAC960.c.orig 2006-01-31 21:32:48.000000000 +0100
+++ linux-2.6.16-rc1-git4/drivers/block/DAC960.c 2006-01-31 21:33:07.000000000 +0100
@@ -229,8 +229,7 @@ static void *slice_dma_loaf(struct dma_l
void *cpu_end = loaf->cpu_free + len;
void *cpu_addr = loaf->cpu_free;
- if (cpu_end > loaf->cpu_base + loaf->length)
- BUG();
+ BUG_ON(cpu_end > loaf->cpu_base + loaf->length);
*dma_handle = loaf->dma_free;
loaf->cpu_free = cpu_end;
loaf->dma_free += len;
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next reply other threads:[~2006-02-01 0:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-01 0:27 Eric Sesterhenn / snakebyte [this message]
2006-02-01 0:28 ` [KJ] [Patch] BUG_ON() Conversion in drivers/ide/ Eric Sesterhenn / snakebyte
2006-02-01 0:28 ` [KJ] [Patch] BUG_ON() Conversion in drivers/media/ Eric Sesterhenn / snakebyte
2006-02-01 0:28 ` [KJ] [Patch] BUG_ON() Conversion in drivers/parisc/ Eric Sesterhenn / snakebyte
2006-02-01 0:28 ` [KJ] [Patch] BUG_ON() Conversion in drivers/video/ Eric Sesterhenn / snakebyte
2006-02-07 21:52 ` [KJ] [Patch] BUG_ON() Conversion in drivers/net/ Eric Sesterhenn
2006-02-07 22:02 ` [KJ] [Patch] BUG_ON() Conversion in drivers/mtd/ Eric Sesterhenn
2006-02-07 23:24 ` [KJ] [Patch] BUG_ON() Conversion in drivers/net/ Håkon Løvdal
2006-02-08 11:07 ` Eric Sesterhenn
2006-02-09 17:25 ` [KJ] [Patch] BUG_ON() Conversion in drivers/scsi Eric Sesterhenn
2006-02-09 17:29 ` [KJ] [Patch] BUG_ON() Conversion in drivers/char Eric Sesterhenn
2006-02-10 15:23 ` [KJ] [Patch] BUG_ON() Conversion in drivers/isdn Eric Sesterhenn
2006-02-20 19:53 ` [KJ] [Patch] BUG_ON() Conversion in drivers/net/ Alexey Dobriyan
2006-02-20 21:48 ` [KJ] [Patch] BUG_ON() Conversion in drivers/scsi Alexey Dobriyan
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=1138753677.9742.10.camel@alice \
--to=snakebyte@gmx.de \
--cc=kernel-janitors@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).