* [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter
@ 2022-05-21 20:16 Tom Rix
2022-05-24 18:10 ` Himanshu Madhani
2022-06-02 2:46 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Tom Rix @ 2022-05-21 20:16 UTC (permalink / raw)
To: njavali, jejb, martin.petersen
Cc: GR-QLogic-Storage-Upstream, linux-scsi, linux-kernel, Tom Rix
cppcheck reports
[drivers/scsi/qla2xxx/qla_mid.c:594]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[drivers/scsi/qla2xxx/qla_mid.c:620]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
The functions qla25xx_free_req_que and qla25xx_free_rsp_que are similar.
They free a 'req' and a 'rsp' parameter respectively. The last statement of
both functions is setting the parameter to NULL. This has no effect and
can be removed.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/scsi/qla2xxx/qla_mid.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index e6b5c4ccce97..346d47b61c07 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -591,7 +591,6 @@ qla25xx_free_req_que(struct scsi_qla_host *vha, struct req_que *req)
}
kfree(req->outstanding_cmds);
kfree(req);
- req = NULL;
}
static void
@@ -617,7 +616,6 @@ qla25xx_free_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp)
mutex_unlock(&ha->vport_lock);
}
kfree(rsp);
- rsp = NULL;
}
int
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter
2022-05-21 20:16 [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter Tom Rix
@ 2022-05-24 18:10 ` Himanshu Madhani
2022-06-02 2:46 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Himanshu Madhani @ 2022-05-24 18:10 UTC (permalink / raw)
To: Tom Rix
Cc: Nilesh Javali, James E.J. Bottomley, Martin Petersen,
GR-QLogic-Storage-Upstream, linux-scsi, linux-kernel
> On May 21, 2022, at 1:16 PM, Tom Rix <trix@redhat.com> wrote:
>
> cppcheck reports
> [drivers/scsi/qla2xxx/qla_mid.c:594]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
> [drivers/scsi/qla2xxx/qla_mid.c:620]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
>
> The functions qla25xx_free_req_que and qla25xx_free_rsp_que are similar.
> They free a 'req' and a 'rsp' parameter respectively. The last statement of
> both functions is setting the parameter to NULL. This has no effect and
> can be removed.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/scsi/qla2xxx/qla_mid.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
> index e6b5c4ccce97..346d47b61c07 100644
> --- a/drivers/scsi/qla2xxx/qla_mid.c
> +++ b/drivers/scsi/qla2xxx/qla_mid.c
> @@ -591,7 +591,6 @@ qla25xx_free_req_que(struct scsi_qla_host *vha, struct req_que *req)
> }
> kfree(req->outstanding_cmds);
> kfree(req);
> - req = NULL;
> }
>
> static void
> @@ -617,7 +616,6 @@ qla25xx_free_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp)
> mutex_unlock(&ha->vport_lock);
> }
> kfree(rsp);
> - rsp = NULL;
> }
>
> int
> --
> 2.27.0
>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
--
Himanshu Madhani Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter
2022-05-21 20:16 [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter Tom Rix
2022-05-24 18:10 ` Himanshu Madhani
@ 2022-06-02 2:46 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-06-02 2:46 UTC (permalink / raw)
To: Tom Rix
Cc: njavali, jejb, martin.petersen, GR-QLogic-Storage-Upstream,
linux-scsi, linux-kernel
Tom,
> The functions qla25xx_free_req_que and qla25xx_free_rsp_que are
> similar. They free a 'req' and a 'rsp' parameter respectively. The
> last statement of both functions is setting the parameter to NULL.
> This has no effect and can be removed.
Applied to 5.19/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-02 2:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21 20:16 [PATCH] scsi: qla2xxx: remove setting of 'req' and 'rsp' parameter Tom Rix
2022-05-24 18:10 ` Himanshu Madhani
2022-06-02 2:46 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.