[PATCH] ieee802154: Remove redundant initialization of variable ret

Subsystems: ieee 802.15.4 subsystem, networking [general], the rest

STALE1793d

2 messages, 2 authors, 2021-09-07 · open the first message on its own page

[PATCH] ieee802154: Remove redundant initialization of variable ret

From: Colin King <hidden>
Date: 2021-09-07 10:28:19

From: Colin Ian King <redacted>

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

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>
---
 net/mac802154/iface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 1cf5ac09edcb..323d3d2d986f 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -617,7 +617,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
 {
 	struct net_device *ndev = NULL;
 	struct ieee802154_sub_if_data *sdata = NULL;
-	int ret = -ENOMEM;
+	int ret;
 
 	ASSERT_RTNL();
 
-- 
2.32.0

Re: [PATCH] ieee802154: Remove redundant initialization of variable ret

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-09-07 13:10:11

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue,  7 Sep 2021 11:28:14 +0100 you wrote:
From: Colin Ian King <redacted>

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

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <redacted>

[...]
Here is the summary with links:
  - ieee802154: Remove redundant initialization of variable ret
    https://git.kernel.org/netdev/net/c/0f77f2defaf6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help