Skip to contentSkip to conversation

NFC: microread: Remove redundant assignment to variable err

PATCH Applied Nigel Christian 3 participants 3 messages Jun 1, 2021 – Jun 2, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 NFC: microread: Remove redundant assignment to variable err

In the case MICROREAD_CB_TYPE_READER_ALL clang reports a dead code warning. The error code assigned to variable err is already passed to async_cb(). The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/nfc/microread/microread.c | 1 -
 1 file changed, 1 deletion(-)
drivers/nfc/microread/microread.c +0 -1
index 8d3988457c58..b1d3975e8a81 100644
@@ -364,7 +364,6 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb,
 	case MICROREAD_CB_TYPE_READER_ALL:
 		if (err == 0) {
 			if (skb->len == 0) {
-				err = -EPROTO;
 				kfree_skb(skb);
 				info->async_cb(info->async_cb_context, NULL,
 					       -EPROTO);
Signature · 1 line
2.31.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 16 lines · Nigel Christian

In the case MICROREAD_CB_TYPE_READER_ALL clang reports a dead code warning. The error code assigned to variable err is already passed to async_cb(). The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/nfc/microread/microread.c | 1 -
 1 file changed, 1 deletion(-)
drivers/nfc/microread/microread.c +0 -0
index 8d3988457c58..b1d3975e8a81 100644

drivers/nfc/microread/microread.c static void microread_im_transceive_cb(void *context, struct sk_buff *skb, · line 369

Quoted 7 lines
drivers/nfc/microread/microread.c +0 -1
@@ -364,7 +364,6 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb,
 	case MICROREAD_CB_TYPE_READER_ALL:
 		if (err == 0) {
 			if (skb->len == 0) {
-				err = -EPROTO;
 				kfree_skb(skb);
 				info->async_cb(info->async_cb_context, NULL,
 					       -EPROTO);

Best regards,
Krzysztof

#2 lore raw
In reply to Nigel Christian
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 8 lines · On Tue, 1 Jun 2021 09:35:33 -0400 you wrote:

In the case MICROREAD_CB_TYPE_READER_ALL clang reports a dead code warning. The error code assigned to variable err is already passed to async_cb(). The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

[...]

Here is the summary with links:
- [v2] NFC: microread: Remove redundant assignment to variable err

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

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