diff mbox series

[1/3] block: simplify queue_logical_block_size

Message ID 20240627111407.476276-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/3] block: simplify queue_logical_block_size | expand

Commit Message

Christoph Hellwig June 27, 2024, 11:14 a.m. UTC
queue_logical_block_size is never called with a 0 queue, and the
logical_block_size field in queue_limits is always initialized for
a live queue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blkdev.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

John Garry June 27, 2024, 12:09 p.m. UTC | #1
On 27/06/2024 12:14, Christoph Hellwig wrote:
> queue_logical_block_size is never called with a 0 queue, and the

nit: could use NULL queue

> logical_block_size field in queue_limits is always initialized for
> a live queue.
> 
> Signed-off-by: Christoph Hellwig<hch@lst.de>

Reviewed-by: John Garry <john.g.garry@oracle.com>
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a53e3434e1a28c..d38bbe7417586f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1228,12 +1228,7 @@  static inline unsigned int bdev_max_segments(struct block_device *bdev)
 
 static inline unsigned queue_logical_block_size(const struct request_queue *q)
 {
-	int retval = 512;
-
-	if (q && q->limits.logical_block_size)
-		retval = q->limits.logical_block_size;
-
-	return retval;
+	return q->limits.logical_block_size;
 }
 
 static inline unsigned int bdev_logical_block_size(struct block_device *bdev)