[PATCH v2 3/4] scsi: sd: drop the dead nr_blocks store
From: shao.mingyin
Date: Fri Nov 06 2026 - 09:37:29 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
sd_setup_atomic_cmnd() writes nr_blocks to cmnd[12] and then writes it
again a few lines later, after the boundary field. The first store is
dead; remove it.
No functional change.
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
No changes in v2.
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index dc45df819c42..6028f9e6cf7d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1408,7 +1408,6 @@ static blk_status_t sd_setup_atomic_cmnd(struct scsi_cmnd *cmd,
cmd->cmnd[0] = WRITE_ATOMIC_16;
cmd->cmnd[1] = flags;
put_unaligned_be64(lba, &cmd->cmnd[2]);
- put_unaligned_be16(nr_blocks, &cmd->cmnd[12]);
if (boundary)
put_unaligned_be16(nr_blocks, &cmd->cmnd[10]);
else