[PATCH] libertas: remove redundant initialization of variable ret

Subsystems: marvell libertas wireless driver, the rest

STALE2014d LANDED

Landed in mainline as 1d5248882d64 on 2021-02-08.

2 messages, 2 authors, 2021-02-08 · open the first message on its own page

[PATCH] libertas: remove redundant initialization of variable ret

From: Colin King <hidden>
Date: 2021-01-28 16:23:24

From: Colin Ian King <redacted>

The variable ret is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/wireless/marvell/libertas/if_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c
index 44fbd0acb87a..a63c5e622ee3 100644
--- a/drivers/net/wireless/marvell/libertas/if_sdio.c
+++ b/drivers/net/wireless/marvell/libertas/if_sdio.c
@@ -981,7 +981,7 @@ static int if_sdio_host_to_card(struct lbs_private *priv,
 
 static int if_sdio_enter_deep_sleep(struct lbs_private *priv)
 {
-	int ret = -1;
+	int ret;
 	struct cmd_header cmd;
 
 	memset(&cmd, 0, sizeof(cmd));
-- 
2.29.2

Re: [PATCH] libertas: remove redundant initialization of variable ret

From: Kalle Valo <hidden>
Date: 2021-02-08 11:33:38

Colin King [off-list ref] wrote:
From: Colin Ian King <redacted>

The variable ret is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>
Patch applied to wireless-drivers-next.git, thanks.

1d5248882d64 libertas: remove redundant initialization of variable ret

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210128162202.642848-1-colin.king@canonical.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help