Skip to contentSkip to conversation

ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data

PATCH In review Colin King 2 participants 2 messages Jun 9, 2021 – Sep 5, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ntb: ntb_pingpong: remove redundant initialization of variables msg_data and spad_data

From: Colin Ian King <[email protected]>

The variables msg_data and spad_data are being initialized with values that are never read, they are being updated later on. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/ntb/test/ntb_pingpong.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ntb/test/ntb_pingpong.c +1 -1
index 2164e8492772..8aeca7914050 100644
@@ -187,7 +187,7 @@ static void pp_ping(struct pp_ctx *pp)
 
 static void pp_pong(struct pp_ctx *pp)
 {
-	u32 msg_data = -1, spad_data = -1;
+	u32 msg_data, spad_data;
 	int pidx = 0;
 
 	/* Read pong data */
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

The variables msg_data and spad_data are being initialized with values that are never read, they are being updated later on. The initializations are redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/ntb/test/ntb_pingpong.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Wow, missed this in my emails log. Thanks for the cleanup.

Quoted 21 lines
drivers/ntb/test/ntb_pingpong.c +1 -1
index 2164e8492772..8aeca7914050 100644
@@ -187,7 +187,7 @@ static void pp_ping(struct pp_ctx *pp)
 
 static void pp_pong(struct pp_ctx *pp)
 {
-	u32 msg_data = -1, spad_data = -1;
+	u32 msg_data, spad_data;
 	int pidx = 0;
 
 	/* Read pong data */
Signature · 6 lines
2.31.1

-- 
You received this message because you are subscribed to the Google Groups "linux-ntb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/linux-ntb/20210609112128.184667-1-colin.king%40canonical.com.