diff mbox series

[next] scsi: elx: efct: remove redundant initialization of variable lun

Message ID 20210616171621.16176-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show
Series [next] scsi: elx: efct: remove redundant initialization of variable lun | expand

Commit Message

Colin King June 16, 2021, 5:16 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable lun 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/elx/efct/efct_unsol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Smart June 18, 2021, 10:50 p.m. UTC | #1
On 6/16/2021 10:16 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable lun 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/elx/efct/efct_unsol.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james
Martin K. Petersen June 19, 2021, 2:24 a.m. UTC | #2
Colin,

> The variable lun 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.14/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/elx/efct/efct_unsol.c b/drivers/scsi/elx/efct/efct_unsol.c
index a9384c9acfde..e6addab66a60 100644
--- a/drivers/scsi/elx/efct/efct_unsol.c
+++ b/drivers/scsi/elx/efct/efct_unsol.c
@@ -342,7 +342,7 @@  efct_dispatch_fcp_cmd(struct efct_node *node, struct efc_hw_sequence *seq)
 	struct fc_frame_header *fchdr = seq->header->dma.virt;
 	struct fcp_cmnd	*cmnd = NULL;
 	struct efct_io *io = NULL;
-	u32 lun = U32_MAX;
+	u32 lun;
 
 	if (!seq->payload) {
 		efc_log_err(efct, "Sequence payload is NULL.\n");