NFC: microread: Pass err variable to async_cb()
Subsystems (4)
PATCH 1/1 NFC: microread: Pass err variable to async_cb()
In the case MICROREAD_CB_TYPE_READER_ALL clang reports a dead code warning. The error code is being directly passed to async_cb(). Fix this by passing the err variable, which is also done in another path.
Addresses-Coverity: ("Unused value")
--- drivers/nfc/microread/microread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/microread/microread.c +1 -1
@@ -367,7 +367,7 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb, err = -EPROTO ;kfree_skb (skb); info->async_cb (info->async_cb_context,NULL , - -EPROTO ); + err);return ; }
Signature · 1 line
2.31.1
Quoted 16 lines · Nigel Christian
In the case
MICROREAD_CB_TYPE_READER_ALLclang reports a dead code warning. The error code is being directly passed toasync_cb(). Fix this by passing the err variable, which is also done in another path.Addresses-Coverity: ("Unused value")
Signed-off-by Nigel Christian <[email protected]>--- drivers/nfc/microread/microread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nfc/microread/microread.c +0
-0
drivers/nfc/microread/microread.c static void microread_im_transceive_cb(void *context, struct sk_buff *skb, · line 367
Quoted 1 line
drivers/nfc/microread/microread.c +0
-0@@ -367,7 +367,7 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb, err = -EPROTO ;
Remove this line instead, please. The err is argument passed by value so assigning it within a function is ugly.
drivers/nfc/microread/microread.c static void microread_im_transceive_cb(void *context, struct sk_buff *skb, · line 373
Quoted 8 lines
drivers/nfc/microread/microread.c +1
-1kfree_skb (skb); info->async_cb (info->async_cb_context,NULL , - -EPROTO ); + err);return ; }
Best regards,
Krzysztof
Quoted 16 lines · Nigel Christian
In the case
MICROREAD_CB_TYPE_READER_ALLclang reports a dead code warning. The error code is being directly passed toasync_cb(). Fix this by passing the err variable, which is also done in another path.Addresses-Coverity: ("Unused value")
Signed-off-by Nigel Christian <[email protected]>--- drivers/nfc/microread/microread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nfc/microread/microread.c +0
-0
drivers/nfc/microread/microread.c static void microread_im_transceive_cb(void *context, struct sk_buff *skb, · line 370
Quoted 5 lines
drivers/nfc/microread/microread.c +1
-1@@ -367,7 +367,7 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb, err = -EPROTO ;kfree_skb (skb); info->async_cb (info->async_cb_context,NULL , - -EPROTO ); + err);
It would be better to just delete the "err = -EPROTO;" assignment.
Literals are more readable. Avoid pointless indirection.
regards,
dan carpenter
Quoted 25 lines · Dan Carpenter
Quoted 16 lines · Nigel Christian
In the case
MICROREAD_CB_TYPE_READER_ALLclang reports a dead code warning. The error code is being directly passed toasync_cb(). Fix this by passing the err variable, which is also done in another path.Addresses-Coverity: ("Unused value")
Signed-off-by Nigel Christian <[email protected]>--- drivers/nfc/microread/microread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nfc/microread/microread.c +0
-0drivers/nfc/microread/microread.c static void microread_im_transceive_cb(void *context, struct sk_buff *skb, · line 370
Quoted 5 lines
drivers/nfc/microread/microread.c +1
-1@@ -367,7 +367,7 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb, err = -EPROTO ;kfree_skb (skb); info->async_cb (info->async_cb_context,NULL , - -EPROTO ); + err);It would be better to just delete the "err =
-EPROTO;" assignment.
Quoted 1 line
Literals are more readable. Avoid pointless indirection.
Yeah, my bad. v2 sent! Thanks Dan!
Quoted 5 lines
regards,
dan carpenter