Skip to contentSkip to conversation

] scsi: qla2xxx: Remove redundant initialization of variable num_cnt

PATCH Applied Colin King 3 participants 5 messages Aug 4, 2021 – Aug 10, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ] scsi: qla2xxx: Remove redundant initialization of variable num_cnt

From: Colin Ian King <[email protected]>

The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/scsi/qla2xxx/qla_edif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_edif.c +1 -1
index fde410989c03..2db954a7aaf1 100644
@@ -875,7 +875,7 @@ static int
 qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
 {
 	int32_t			rval = 0;
-	int32_t			num_cnt = 1;
+	int32_t			num_cnt;
 	struct fc_bsg_reply	*bsg_reply = bsg_job->reply;
 	struct app_pinfo_req	app_req;
 	struct app_pinfo_reply	*app_reply;
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Colin King

From: Colin Ian King <[email protected]>

The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
  drivers/scsi/qla2xxx/qla_edif.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_edif.c +0 -0
index fde410989c03..2db954a7aaf1 100644

drivers/scsi/qla2xxx/qla_edif.c static int · line 881

Quoted 8 lines
drivers/scsi/qla2xxx/qla_edif.c +1 -1
@@ -875,7 +875,7 @@ static int
  qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
  {
  	int32_t			rval = 0;
-	int32_t			num_cnt = 1;
+	int32_t			num_cnt;
  	struct fc_bsg_reply	*bsg_reply = bsg_job->reply;
  	struct app_pinfo_req	app_req;
  	struct app_pinfo_reply	*app_reply;

Looks Good.

(I am curious if that extra "next" in patch subject was a typo or some workflow added that)

Signature · 1 line
Himanshu Madhani                                Oracle Linux Engineering
#2 lore raw
Quoted 33 lines · Himanshu Madhani
Quoted 19 lines · Colin King

From: Colin Ian King <[email protected]>

The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
  drivers/scsi/qla2xxx/qla_edif.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_edif.c +0 -0
index fde410989c03..2db954a7aaf1 100644

drivers/scsi/qla2xxx/qla_edif.c static int · line 881

Quoted 8 lines
drivers/scsi/qla2xxx/qla_edif.c +1 -1
@@ -875,7 +875,7 @@ static int
   qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
   {
       int32_t            rval = 0;
-    int32_t            num_cnt = 1;
+    int32_t            num_cnt;
       struct fc_bsg_reply    *bsg_reply = bsg_job->reply;
       struct app_pinfo_req    app_req;
       struct app_pinfo_reply    *app_reply;

Looks Good.

Quoted 2 lines

(I am curious if that extra "next" in patch subject was a typo or some workflow added that)

It was an accidental double paste. My bad.

Quoted 3 lines
#3 lore raw
In reply to Colin King

Colin,

Quoted 3 lines

The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.

Applied to 5.15/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable num_cnt is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.

[...]

Applied to 5.15/scsi-queue, thanks!

[1/1] scsi: qla2xxx: Remove redundant initialization of variable num_cnt

      https://git.kernel.org/mkp/scsi/c/77d0f07abada
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering