Commit 089fe1b2 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Adrian Bunk

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: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 817dd6ee
...@@ -228,8 +228,7 @@ static void *slice_dma_loaf(struct dma_loaf *loaf, size_t len, ...@@ -228,8 +228,7 @@ static void *slice_dma_loaf(struct dma_loaf *loaf, size_t len,
void *cpu_end = loaf->cpu_free + len; void *cpu_end = loaf->cpu_free + len;
void *cpu_addr = loaf->cpu_free; void *cpu_addr = loaf->cpu_free;
if (cpu_end > loaf->cpu_base + loaf->length) BUG_ON(cpu_end > loaf->cpu_base + loaf->length);
BUG();
*dma_handle = loaf->dma_free; *dma_handle = loaf->dma_free;
loaf->cpu_free = cpu_end; loaf->cpu_free = cpu_end;
loaf->dma_free += len; loaf->dma_free += len;
......
...@@ -2361,8 +2361,7 @@ static void do_cciss_request(request_queue_t *q) ...@@ -2361,8 +2361,7 @@ static void do_cciss_request(request_queue_t *q)
if (!creq) if (!creq)
goto startio; goto startio;
if (creq->nr_phys_segments > MAXSGENTRIES) BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);
BUG();
if (( c = cmd_alloc(h, 1)) == NULL) if (( c = cmd_alloc(h, 1)) == NULL)
goto full; goto full;
......
...@@ -1316,7 +1316,7 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd ...@@ -1316,7 +1316,7 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd
cp->Request.Timeout = 0; cp->Request.Timeout = 0;
memset(cp->Request.CDB, 0, sizeof(cp->Request.CDB)); 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; cp->Request.CDBLen = cmd->cmd_len;
memcpy(cp->Request.CDB, cmd->cmnd, cmd->cmd_len); memcpy(cp->Request.CDB, cmd->cmnd, cmd->cmd_len);
cp->Request.Type.Type = TYPE_CMD; cp->Request.Type.Type = TYPE_CMD;
......
...@@ -906,8 +906,7 @@ static void do_ida_request(request_queue_t *q) ...@@ -906,8 +906,7 @@ static void do_ida_request(request_queue_t *q)
if (!creq) if (!creq)
goto startio; goto startio;
if (creq->nr_phys_segments > SG_MAX) BUG_ON(creq->nr_phys_segments > SG_MAX);
BUG();
if ((c = cmd_alloc(h,1)) == NULL) if ((c = cmd_alloc(h,1)) == NULL)
goto startio; goto startio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment