diff mbox series

[next[next] ] scsi: qla2xxx: Remove redundant initialization of variable num_cnt

Message ID 20210804131344.112635-1-colin.king@canonical.com
State New
Headers show
Series [next[next] ] scsi: qla2xxx: Remove redundant initialization of variable num_cnt | expand

Commit Message

Colin King Aug. 4, 2021, 1:13 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla2xxx/qla_edif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Colin King Aug. 4, 2021, 3:09 p.m. UTC | #1
On 04/08/2021 16:08, Himanshu Madhani wrote:
> 
> 
> On 8/4/21 8:13 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/scsi/qla2xxx/qla_edif.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/qla2xxx/qla_edif.c
>> b/drivers/scsi/qla2xxx/qla_edif.c
>> index fde410989c03..2db954a7aaf1 100644
>> --- a/drivers/scsi/qla2xxx/qla_edif.c
>> +++ b/drivers/scsi/qla2xxx/qla_edif.c
>> @@ -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)

It was an accidental double paste. My bad.

> 
> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
>
Martin K. Petersen Aug. 6, 2021, 3:13 a.m. UTC | #2
Colin,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering
Martin K. Petersen Aug. 10, 2021, 5:20 a.m. UTC | #3
On Wed, 4 Aug 2021 14:13:44 +0100, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>

> 

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
index fde410989c03..2db954a7aaf1 100644
--- a/drivers/scsi/qla2xxx/qla_edif.c
+++ b/drivers/scsi/qla2xxx/qla_edif.c
@@ -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;