From: Eric Sesterhenn Date: Fri, 31 Mar 2006 23:08:49 +0000 (+0200) Subject: BUG_ON() Conversion in md/raid1.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e77c485f7037e4817bb53c78d15d5403981ae8b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git BUG_ON() Conversion in md/raid1.c this changes if() BUG(); constructs to BUG_ON() which is cleaner and can better optimized away Signed-off-by: Eric Sesterhenn Signed-off-by: Adrian Bunk --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 9b374c91db66..6081941de1b3 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1558,8 +1558,7 @@ static int init_resync(conf_t *conf) int buffs; buffs = RESYNC_WINDOW / RESYNC_BLOCK_SIZE; - if (conf->r1buf_pool) - BUG(); + BUG_ON(conf->r1buf_pool); conf->r1buf_pool = mempool_create(buffs, r1buf_pool_alloc, r1buf_pool_free, conf->poolinfo); if (!conf->r1buf_pool) @@ -1732,8 +1731,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) break; - if (sync_blocks < (PAGE_SIZE>>9)) - BUG(); + BUG_ON(sync_blocks < (PAGE_SIZE>>9)); if (len > (sync_blocks<<9)) len = sync_blocks<<9; }