[PATCH] bonding: remove redundant initialization of variable ret

Subsystems: bonding driver, networking drivers, the rest

STALE1918d

2 messages, 2 authors, 2021-06-03 · open the first message on its own page

[PATCH] bonding: remove redundant initialization of variable ret

From: Colin King <hidden>
Date: 2021-06-03 13:19:10

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>
---
 drivers/net/bonding/bond_options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index c9d3604ae129..6fb68eaa647d 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -705,7 +705,7 @@ int __bond_opt_set(struct bonding *bond,
 int __bond_opt_set_notify(struct bonding *bond,
 			  unsigned int option, struct bond_opt_value *val)
 {
-	int ret = -ENOENT;
+	int ret;
 
 	ASSERT_RTNL();
 
-- 
2.31.1

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

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-03 22:30:10

Hello:

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

On Thu,  3 Jun 2021 14:19:04 +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:
  - bonding: remove redundant initialization of variable ret
    https://git.kernel.org/netdev/net-next/c/92e1b57c3865

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