kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [Patch] BUG_ON() Conversion in drivers/block/
@ 2006-02-01  0:27 Eric Sesterhenn / snakebyte
  2006-02-01  0:28 ` [KJ] [Patch] BUG_ON() Conversion in drivers/ide/ Eric Sesterhenn / snakebyte
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Eric Sesterhenn / snakebyte @ 2006-02-01  0:27 UTC (permalink / raw)
  To: kernel-janitors

[-- 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-02-20 21:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-01  0:27 [KJ] [Patch] BUG_ON() Conversion in drivers/block/ Eric Sesterhenn / snakebyte
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

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).