[PATCH] cxgb4: Delete an unnecessary check before the function call "release_firmware"

Subsystems: cxgb4 ethernet driver (cxgb4), networking drivers, the rest

STALE4279d

2 messages, 2 authors, 2015-02-05 · open the first message on its own page

[PATCH] cxgb4: Delete an unnecessary check before the function call "release_firmware"

From: SF Markus Elfring <hidden>
Date: 2015-02-04 10:38:55

From: Markus Elfring <redacted>
Date: Wed, 4 Feb 2015 11:28:43 +0100

The release_firmware() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 1147e1e..6d08b8c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -5129,8 +5129,7 @@ static int adap_init0(struct adapter *adap)
 				 state, &reset);
 
 		/* Cleaning up */
-		if (fw != NULL)
-			release_firmware(fw);
+		release_firmware(fw);
 		t4_free_mem(card_fw);
 
 		if (ret < 0)
-- 
2.2.2

Re: [PATCH] cxgb4: Delete an unnecessary check before the function call "release_firmware"

From: David Miller <davem@davemloft.net>
Date: 2015-02-05 08:07:06

From: SF Markus Elfring <redacted>
Date: Wed, 04 Feb 2015 11:38:39 +0100
From: Markus Elfring <redacted>
Date: Wed, 4 Feb 2015 11:28:43 +0100

The release_firmware() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help