Skip to contentSkip to conversation

target/core: Use the SECTOR_SHIFT constant

PATCH Applied Bart Van Assche 1 participant 1 message Oct 15, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 target/core: Use the SECTOR_SHIFT constant

Instead of duplicating the SECTOR_SHIFT definition from <linux/blkdev.h>, use it. This patch does not change any functionality.

Cc Nicholas Bellinger <[email protected]>
Cc Mike Christie <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 drivers/target/target_core_iblock.c | 4 ++--
 drivers/target/target_core_iblock.h | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/target/target_core_iblock.c +2 -2
index ce1321a5cb7b..1bc9b14236d8 100644
@@ -514,7 +514,7 @@ iblock_execute_write_same(struct se_cmd *cmd)
 		}
 
 		/* Always in 512 byte units for Linux/Block */
-		block_lba += sg->length >> IBLOCK_LBA_SHIFT;
+		block_lba += sg->length >> SECTOR_SHIFT;
 		sectors -= 1;
 	}
 
@@ -757,7 +757,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 		}
 
 		/* Always in 512 byte units for Linux/Block */
-		block_lba += sg->length >> IBLOCK_LBA_SHIFT;
+		block_lba += sg->length >> SECTOR_SHIFT;
 		sg_num--;
 	}
 
drivers/target/target_core_iblock.h +0 -1
index 9cc3843404d4..cefc641145b3 100644
@@ -9,7 +9,6 @@
 #define IBLOCK_VERSION		"4.0"
 
 #define IBLOCK_MAX_CDBS		16
-#define IBLOCK_LBA_SHIFT	9
 
 struct iblock_req {
 	refcount_t pending;
Signature · 1 line
2.19.0.605.g01d371f741-goog