Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH][next] scsi: scsi_debug: remove a redundant assignment to variable ret
@ 2024-10-02 13:50 Colin Ian King
  2024-10-02 15:10 ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Colin Ian King @ 2024-10-02 13:50 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

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@gmail.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


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

end of thread, other threads:[~2024-10-17  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02 13:50 [PATCH][next] scsi: scsi_debug: remove a redundant assignment to variable ret Colin Ian King
2024-10-02 15:10 ` Dan Carpenter
2024-10-02 15:19   ` Dan Carpenter
2024-10-16  7:16   ` John Garry
2024-10-17  7:59     ` John Garry
2024-10-17  8:57     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox