[PATCH v2] NFC: microread: Remove redundant assignment to variable err

Subsystems: nfc subsystem, the rest

STALE1930d

3 messages, 3 authors, 2021-06-02 · open the first message on its own page

[PATCH v2] NFC: microread: Remove redundant assignment to variable err

From: Nigel Christian <hidden>
Date: 2021-06-01 13:35:40

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")
Signed-off-by: Nigel Christian <redacted>
---
 drivers/nfc/microread/microread.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
index 8d3988457c58..b1d3975e8a81 100644
--- a/drivers/nfc/microread/microread.c
+++ b/drivers/nfc/microread/microread.c
@@ -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);
-- 
2.31.1

Re: [PATCH v2] NFC: microread: Remove redundant assignment to variable err

From: Krzysztof Kozlowski <hidden>
Date: 2021-06-01 13:41:49

On 01/06/2021 15:35, Nigel Christian wrote:
quoted hunk
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")
Signed-off-by: Nigel Christian <redacted>
---
 drivers/nfc/microread/microread.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
index 8d3988457c58..b1d3975e8a81 100644
--- a/drivers/nfc/microread/microread.c
+++ b/drivers/nfc/microread/microread.c
@@ -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);

Reviewed-by: Krzysztof Kozlowski <redacted>

Best regards,
Krzysztof

Re: [PATCH v2] NFC: microread: Remove redundant assignment to variable err

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-02 00:10:25

Hello:

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

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")
Signed-off-by: Nigel Christian <redacted>

[...]
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

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