diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2012-11-08 15:23:09 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-11-12 18:20:44 -0500 |
commit | 0449410b0b8aeafa9b7e8bb719e4eeda8a5623fd (patch) | |
tree | 84867c61bd5e0f2185ee6a9e2b7e46c1e78d78b1 /arch/arm | |
parent | 63d5fc0c2f748e20f38a0a0ec1c8494bddf5c288 (diff) |
ARM: OMAP1: use BUG_ON where possible
Just use BUG_ON() instead of constructions such as:
if (...)
BUG()
A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
@@
- if (e) BUG();
+ BUG_ON(e);
// </smpl>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/board-fsample.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h3.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-perseus2.c | 3 |
4 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 4b6de70c47a6..756872e9c337 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -307,8 +307,7 @@ static void __init omap_fsample_init(void) | |||
307 | 307 | ||
308 | fsample_init_smc91x(); | 308 | fsample_init_smc91x(); |
309 | 309 | ||
310 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 310 | BUG_ON(gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0); |
311 | BUG(); | ||
312 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); | 311 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); |
313 | 312 | ||
314 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 313 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 376f7f29ef77..9d533ee7aee0 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -411,8 +411,7 @@ static void __init h2_init(void) | |||
411 | 411 | ||
412 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | 412 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; |
413 | h2_nand_resource.end += SZ_4K - 1; | 413 | h2_nand_resource.end += SZ_4K - 1; |
414 | if (gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 414 | BUG_ON(gpio_request(H2_NAND_RB_GPIO_PIN, "NAND ready") < 0); |
415 | BUG(); | ||
416 | gpio_direction_input(H2_NAND_RB_GPIO_PIN); | 415 | gpio_direction_input(H2_NAND_RB_GPIO_PIN); |
417 | 416 | ||
418 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 417 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index ededdb7ef28c..be60862945a3 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -406,8 +406,7 @@ static void __init h3_init(void) | |||
406 | 406 | ||
407 | nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; | 407 | nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS; |
408 | nand_resource.end += SZ_4K - 1; | 408 | nand_resource.end += SZ_4K - 1; |
409 | if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 409 | BUG_ON(gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0); |
410 | BUG(); | ||
411 | gpio_direction_input(H3_NAND_RB_GPIO_PIN); | 410 | gpio_direction_input(H3_NAND_RB_GPIO_PIN); |
412 | 411 | ||
413 | /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ | 412 | /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ |
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 198b05417bfc..327ffcf6e9a4 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -275,8 +275,7 @@ static void __init omap_perseus2_init(void) | |||
275 | 275 | ||
276 | perseus2_init_smc91x(); | 276 | perseus2_init_smc91x(); |
277 | 277 | ||
278 | if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 278 | BUG_ON(gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0); |
279 | BUG(); | ||
280 | gpio_direction_input(P2_NAND_RB_GPIO_PIN); | 279 | gpio_direction_input(P2_NAND_RB_GPIO_PIN); |
281 | 280 | ||
282 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 281 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |