aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-10-02 00:37:07 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-04 01:06:11 -0400
commit1790c228fb3f57793160c0f0c20b55c398cab106 (patch)
tree70034ca360b83b8e8f63c711b8a49bfc6b7eee3c /drivers/atm
parentf009627b71eacfeede3d63b00a25afdf5e3e24bb (diff)
drivers/atm/idt77252.c: Remove unnecessary error check
This code does not call deinit_card(card); in an error case, as done in other error-handling code in the same function. But actually, the called function init_sram can only return 0, so there is no need for the error check at all. init_sram is also given a void return type, and its single return statement at the end of the function is dropped. A simplified version of the sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ @r@ statement S1,S2,S3; constant C1,C2,C3; @@ *if (...) {... S1 return -C1;} ... *if (...) {... when != S1 return -C2;} ... *if (...) {... S1 return -C3;} // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/idt77252.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 1679cbf0c584..bce57328ddde 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3152,7 +3152,7 @@ deinit_card(struct idt77252_dev *card)
3152} 3152}
3153 3153
3154 3154
3155static int __devinit 3155static void __devinit
3156init_sram(struct idt77252_dev *card) 3156init_sram(struct idt77252_dev *card)
3157{ 3157{
3158 int i; 3158 int i;
@@ -3298,7 +3298,6 @@ init_sram(struct idt77252_dev *card)
3298 SAR_REG_RXFD); 3298 SAR_REG_RXFD);
3299 3299
3300 IPRINTK("%s: SRAM initialization complete.\n", card->name); 3300 IPRINTK("%s: SRAM initialization complete.\n", card->name);
3301 return 0;
3302} 3301}
3303 3302
3304static int __devinit 3303static int __devinit
@@ -3410,8 +3409,7 @@ init_card(struct atm_dev *dev)
3410 3409
3411 writel(readl(SAR_REG_CFG) | conf, SAR_REG_CFG); 3410 writel(readl(SAR_REG_CFG) | conf, SAR_REG_CFG);
3412 3411
3413 if (init_sram(card) < 0) 3412 init_sram(card);
3414 return -1;
3415 3413
3416/********************************************************************/ 3414/********************************************************************/
3417/* A L L O C R A M A N D S E T V A R I O U S T H I N G S */ 3415/* A L L O C R A M A N D S E T V A R I O U S T H I N G S */