aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-05-28 12:41:17 -0400
committerBrian Norris <computersforpeace@gmail.com>2016-07-09 21:48:54 -0400
commit8bf66b24cfcb71d6f3e33a0ebd119678823d7c70 (patch)
treec559302ae7a4050576362dbdc77ec11cf522e92d /drivers/mtd
parentb137aab438382fdadfe1272869357485af0252b4 (diff)
mtd: Replace if and BUG with BUG_ON
Replace if condition and BUG() with a BUG_ON having the conditional expression of the if statement as argument. The Coccinelle semantic patch used to make this change is as follows: @@ expression E,f; @@ ( if (<+... f(...) ...+>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ssfdc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c
index daf82ba7aba0..41b13d1cdcc4 100644
--- a/drivers/mtd/ssfdc.c
+++ b/drivers/mtd/ssfdc.c
@@ -380,8 +380,7 @@ static int ssfdcr_readsect(struct mtd_blktrans_dev *dev,
380 " block_addr=%d\n", logic_sect_no, sectors_per_block, offset, 380 " block_addr=%d\n", logic_sect_no, sectors_per_block, offset,
381 block_address); 381 block_address);
382 382
383 if (block_address >= ssfdc->map_len) 383 BUG_ON(block_address >= ssfdc->map_len);
384 BUG();
385 384
386 block_address = ssfdc->logic_block_map[block_address]; 385 block_address = ssfdc->logic_block_map[block_address];
387 386