diff mbox series

scsi: ufs: ufshpb: Remove redundant initialization of variable lba

Message ID 20210804133241.113509-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show
Series scsi: ufs: ufshpb: Remove redundant initialization of variable lba | expand

Commit Message

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

The variable lba 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/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Aug. 10, 2021, 3:43 a.m. UTC | #1
Colin,

> The variable lba 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 Aug. 17, 2021, 3:17 a.m. UTC | #2
On Wed, 4 Aug 2021 14:32:41 +0100, Colin King wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable lba 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: ufs: ufshpb: Remove redundant initialization of variable lba
      https://git.kernel.org/mkp/scsi/c/102851fc9a0d
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 40d371f6e147..e3cd033b6885 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -371,7 +371,7 @@  static void ufshcd_add_uic_command_trace(struct ufs_hba *hba,
 static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
 				     enum ufs_trace_str_t str_t)
 {
-	u64 lba = -1;
+	u64 lba;
 	u8 opcode = 0, group_id = 0;
 	u32 intr, doorbell;
 	struct ufshcd_lrb *lrbp = &hba->lrb[tag];