Skip to contentSkip to conversation

nfc: st21nfca: remove redundant assignment to variable i

PATCH Applied Colin Ian King 3 participants 3 messages Dec 30, 2021 – Dec 31, 2021

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

PATCH 1/1 nfc: st21nfca: remove redundant assignment to variable i

Variable i is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan build warning:

drivers/nfc/st21nfca/i2c.c:319:4: warning: Value stored to 'i' is never read [deadcode.DeadStores]

                        i = 0;
---
 drivers/nfc/st21nfca/i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/nfc/st21nfca/i2c.c +1 -3
index f126ce96a7df..05157fc0f4eb 100644
@@ -315,10 +315,8 @@ static int st21nfca_hci_i2c_repack(struct sk_buff *skb)
 		skb_pull(skb, 1);
 
 		r = check_crc(skb->data, skb->len);
-		if (r != 0) {
-			i = 0;
+		if (r != 0)
 			return -EBADMSG;
-		}
 
 		/* remove headbyte */
 		skb_pull(skb, 1);
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Colin Ian King

Variable i is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan build warning:

Quoted 9 lines

drivers/nfc/st21nfca/i2c.c:319:4: warning: Value stored to 'i' is never read [deadcode.DeadStores]

                        i = 0;
---
 drivers/nfc/st21nfca/i2c.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Best regards,
Krzysztof

#2 lore raw
In reply to Colin Ian King
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 30 Dec 2021 16:12:30 +0000 you wrote:

Variable i is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan build warning:

drivers/nfc/st21nfca/i2c.c:319:4: warning: Value stored to 'i' is never read [deadcode.DeadStores]

                        i = 0;

[...]

Here is the summary with links:
- nfc: st21nfca: remove redundant assignment to variable i

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

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html