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

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>

authored by

Amitoj Kaur Chawla and committed by
Brian Norris
8bf66b24 b137aab4

+1 -2
+1 -2
drivers/mtd/ssfdc.c
··· 380 380 " block_addr=%d\n", logic_sect_no, sectors_per_block, offset, 381 381 block_address); 382 382 383 - if (block_address >= ssfdc->map_len) 384 - BUG(); 383 + BUG_ON(block_address >= ssfdc->map_len); 385 384 386 385 block_address = ssfdc->logic_block_map[block_address]; 387 386