Skip to contentSkip to conversation

ieee802154: hwsim: remove redundant initialization of variable res

PATCH Applied Colin King 2 participants 2 messages Mar 29, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ieee802154: hwsim: remove redundant initialization of variable res

From: Colin Ian King <[email protected]>

The variable res 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")

---
 drivers/net/ieee802154/mac802154_hwsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/mac802154_hwsim.c +1 -1
index c0bf7d78276e..da9135231c07 100644
@@ -268,7 +268,7 @@ static int hwsim_get_radio(struct sk_buff *skb, struct hwsim_phy *phy,
 			   struct netlink_callback *cb, int flags)
 {
 	void *hdr;
-	int res = -EMSGSIZE;
+	int res;
 
 	hdr = genlmsg_put(skb, portid, seq, &hwsim_genl_family, flags,
 			  MAC802154_HWSIM_CMD_GET_RADIO);
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 10 lines · On Mon, 29 Mar 2021 12:23:54 +0100 you wrote:

From: Colin Ian King <[email protected]>

The variable res 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")

[...]

Here is the summary with links:
- ieee802154: hwsim: remove redundant initialization of variable res

    https://git.kernel.org/netdev/net-next/c/24ad92c841c9

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