Skip to content

Commit

Permalink
BUG_ON() Conversion in md/dm-table.c
Browse files Browse the repository at this point in the history
this changes if() BUG(); constructs to BUG_ON() which is
cleaner and can better optimized away

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
  • Loading branch information
Eric Sesterhenn authored and Adrian Bunk committed Mar 26, 2006
1 parent c163c72 commit 547bc92
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ static int open_dev(struct dm_dev *d, dev_t dev)

int r;

if (d->bdev)
BUG();
BUG_ON(d->bdev);

bdev = open_by_devnum(dev, d->mode);
if (IS_ERR(bdev))
Expand Down Expand Up @@ -427,8 +426,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
struct dm_dev *dd;
unsigned int major, minor;

if (!t)
BUG();
BUG_ON(!t);

if (sscanf(path, "%u:%u", &major, &minor) == 2) {
/* Extract the major/minor numbers */
Expand Down

0 comments on commit 547bc92

Please sign in to comment.