public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: [PATCH 1/3] block: simplify queue_logical_block_size
Date: Thu, 27 Jun 2024 13:14:01 +0200	[thread overview]
Message-ID: <20240627111407.476276-2-hch@lst.de> (raw)
In-Reply-To: <20240627111407.476276-1-hch@lst.de>

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(-)

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)
-- 
2.43.0


  reply	other threads:[~2024-06-27 11:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 11:14 de-duplicate the block sysfs code Christoph Hellwig
2024-06-27 11:14 ` Christoph Hellwig [this message]
2024-06-27 12:09   ` [PATCH 1/3] block: simplify queue_logical_block_size John Garry
2024-06-27 11:14 ` [PATCH 2/3] block: add helper macros to de-duplicate the queue sysfs attributes Christoph Hellwig
2024-06-27 12:15   ` John Garry
2024-06-27 11:14 ` [PATCH 3/3] block: pass a gendisk to the queue_sysfs_entry methods Christoph Hellwig
2024-06-28 21:09 ` de-duplicate the block sysfs code Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627111407.476276-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox