Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

BUG_ON() Conversion in drivers/block/

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>
Signed-off-by: Adrian Bunk <bunk@stusta.de>

authored by

Eric Sesterhenn and committed by
Adrian Bunk
089fe1b2 817dd6ee

+4 -7
+1 -2
drivers/block/DAC960.c
··· 228 228 void *cpu_end = loaf->cpu_free + len; 229 229 void *cpu_addr = loaf->cpu_free; 230 230 231 - if (cpu_end > loaf->cpu_base + loaf->length) 232 - BUG(); 231 + BUG_ON(cpu_end > loaf->cpu_base + loaf->length); 233 232 *dma_handle = loaf->dma_free; 234 233 loaf->cpu_free = cpu_end; 235 234 loaf->dma_free += len;
+1 -2
drivers/block/cciss.c
··· 2361 2361 if (!creq) 2362 2362 goto startio; 2363 2363 2364 - if (creq->nr_phys_segments > MAXSGENTRIES) 2365 - BUG(); 2364 + BUG_ON(creq->nr_phys_segments > MAXSGENTRIES); 2366 2365 2367 2366 if (( c = cmd_alloc(h, 1)) == NULL) 2368 2367 goto full;
+1 -1
drivers/block/cciss_scsi.c
··· 1316 1316 1317 1317 cp->Request.Timeout = 0; 1318 1318 memset(cp->Request.CDB, 0, sizeof(cp->Request.CDB)); 1319 - if (cmd->cmd_len > sizeof(cp->Request.CDB)) BUG(); 1319 + BUG_ON(cmd->cmd_len > sizeof(cp->Request.CDB)); 1320 1320 cp->Request.CDBLen = cmd->cmd_len; 1321 1321 memcpy(cp->Request.CDB, cmd->cmnd, cmd->cmd_len); 1322 1322 cp->Request.Type.Type = TYPE_CMD;
+1 -2
drivers/block/cpqarray.c
··· 906 906 if (!creq) 907 907 goto startio; 908 908 909 - if (creq->nr_phys_segments > SG_MAX) 910 - BUG(); 909 + BUG_ON(creq->nr_phys_segments > SG_MAX); 911 910 912 911 if ((c = cmd_alloc(h,1)) == NULL) 913 912 goto startio;