[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241002135043.942327-1-colin.i.king@gmail.com>
Date: Wed, 2 Oct 2024 14:50:43 +0100
From: Colin Ian King <colin.i.king@...il.com>
To: "James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH][next] scsi: scsi_debug: remove a redundant assignment to variable ret
The variable ret is being assigned a value that is never read, the
following break statement exits the loop where ret is being re-assigned
a new value. Remove the redundant assignment.
Signed-off-by: Colin Ian King <colin.i.king@...il.com>
---
drivers/scsi/scsi_debug.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index d95f417e24c0..7c60f5acc4a3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3686,14 +3686,12 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp,
sdeb_data_sector_lock(sip, do_write);
ret = sg_copy_buffer(sdb->table.sgl, sdb->table.nents,
fsp + (block * sdebug_sector_size),
sdebug_sector_size, sg_skip, do_write);
sdeb_data_sector_unlock(sip, do_write);
- if (ret != sdebug_sector_size) {
- ret += (i * sdebug_sector_size);
+ if (ret != sdebug_sector_size)
break;
- }
sg_skip += sdebug_sector_size;
if (++block >= sdebug_store_sectors)
block = 0;
}
ret = num * sdebug_sector_size;
--
2.39.5
Powered by blists - more mailing lists