Skip to contentSkip to conversation

block: return unsigned int from bdev_io_min

PATCH Applied Christoph Hellwig 4 participants 5 messages Nov 19, 2024 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: return unsigned int from bdev_io_min

The underlying limit is defined as an unsigned int, so return that from bdev_io_min as well.

Fixes ac481c20ef8f ("block: Topology ioctls")
---
 include/linux/blkdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blkdev.h +1 -1
index 00212e96261a..4825469c2fa1 100644
@@ -1261,7 +1261,7 @@ static inline unsigned int queue_io_min(const struct request_queue *q)
 	return q->limits.io_min;
 }
 
-static inline int bdev_io_min(struct block_device *bdev)
+static inline unsigned int bdev_io_min(struct block_device *bdev)
 {
 	return queue_io_min(bdev_get_queue(bdev));
 }
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

The underlying limit is defined as an unsigned int, so return that from bdev_io_min as well.

There seem to be other helpers with the same condition.

Even bdev_io_opt() is defined as returning an int, but actually returns an unsigned int. And even though not a bdev helper, queue_dma_alignment() is similar.

Quoted 2 lines
Fixes ac481c20ef8f ("block: Topology ioctls")
Quoted 17 lines
---
  include/linux/blkdev.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/blkdev.h +1 -1
index 00212e96261a..4825469c2fa1 100644
@@ -1261,7 +1261,7 @@ static inline unsigned int queue_io_min(const struct request_queue *q)
  	return q->limits.io_min;
  }
 
-static inline int bdev_io_min(struct block_device *bdev)
+static inline unsigned int bdev_io_min(struct block_device *bdev)
  {
  	return queue_io_min(bdev_get_queue(bdev));
  }
#3 lore raw
Quoted 10 lines · John Garry
Quoted 3 lines · Christoph Hellwig

The underlying limit is defined as an unsigned int, so return that from bdev_io_min as well.

There seem to be other helpers with the same condition.

Even bdev_io_opt() is defined as returning an int, but actually returns an unsigned int. And even though not a bdev helper, queue_dma_alignment() is similar.

True. I'll cook up patches - I just noticed this one because of a series that added casts to the return value which made me look there.

maintainer Applied
#4 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

The underlying limit is defined as an unsigned int, so return that from bdev_io_min as well.

Applied, thanks!

[1/1] block: return unsigned int from bdev_io_min

      commit: 46fd48ab3ea3eb3bb215684bd66ea3d260b091a9

Best regards,

Signature · 1 line
Jens Axboe