[PATCH] nfc: st-nci: remove redundant assignment to variable r

Subsystems: nfc subsystem, the rest

STALE2589d

2 messages, 2 authors, 2019-07-02 · open the first message on its own page

[PATCH] nfc: st-nci: remove redundant assignment to variable r

From: Colin King <hidden>
Date: 2019-07-02 13:16:45

From: Colin Ian King <redacted>

The variable r 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")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/nfc/st-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 67a685adfd44..55d600cd3861 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -72,7 +72,7 @@ static void st_nci_i2c_disable(void *phy_id)
  */
 static int st_nci_i2c_write(void *phy_id, struct sk_buff *skb)
 {
-	int r = -1;
+	int r;
 	struct st_nci_i2c_phy *phy = phy_id;
 	struct i2c_client *client = phy->i2c_dev;
 
-- 
2.20.1

Re: [PATCH] nfc: st-nci: remove redundant assignment to variable r

From: David Miller <davem@davemloft.net>
Date: 2019-07-02 19:02:37

From: Colin King <redacted>
Date: Tue,  2 Jul 2019 14:16:42 +0100
From: Colin Ian King <redacted>

The variable r 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")
Signed-off-by: Colin Ian King <redacted>
Applied to net-next.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help