linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt
@ 2021-08-04 13:13 Colin King
  2021-08-04 15:08 ` Himanshu Madhani
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Colin King @ 2021-08-04 13:13 UTC (permalink / raw)
  To: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt
  2021-08-04 13:13 [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt Colin King
@ 2021-08-04 15:08 ` Himanshu Madhani
  2021-08-04 15:09   ` Colin Ian King
  2021-08-06  3:13 ` Martin K. Petersen
  2021-08-10  5:20 ` Martin K. Petersen
  2 siblings, 1 reply; 5+ messages in thread
From: Himanshu Madhani @ 2021-08-04 15:08 UTC (permalink / raw)
  To: Colin King, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel



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)

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

-- 
Himanshu Madhani                                Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt
  2021-08-04 15:08 ` Himanshu Madhani
@ 2021-08-04 15:09   ` Colin Ian King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Ian King @ 2021-08-04 15:09 UTC (permalink / raw)
  To: Himanshu Madhani, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt
  2021-08-04 13:13 [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt Colin King
  2021-08-04 15:08 ` Himanshu Madhani
@ 2021-08-06  3:13 ` Martin K. Petersen
  2021-08-10  5:20 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-08-06  3:13 UTC (permalink / raw)
  To: Colin King
  Cc: Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	kernel-janitors, linux-kernel


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt
  2021-08-04 13:13 [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt Colin King
  2021-08-04 15:08 ` Himanshu Madhani
  2021-08-06  3:13 ` Martin K. Petersen
@ 2021-08-10  5:20 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-08-10  5:20 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, linux-scsi, Nilesh Javali,
	GR-QLogic-Storage-Upstream
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-10  5:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 13:13 [PATCH][next[next]] scsi: qla2xxx: Remove redundant initialization of variable num_cnt Colin King
2021-08-04 15:08 ` Himanshu Madhani
2021-08-04 15:09   ` Colin Ian King
2021-08-06  3:13 ` Martin K. Petersen
2021-08-10  5:20 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).