diff mbox series

[6/6] block: return bool from get_disk_ro and bdev_read_only

Message ID 20241119160932.1327864-7-hch@lst.de (mailing list archive)
State New
Headers show
Series [1/6] block: return unsigned int from bdev_io_opt | expand

Commit Message

Christoph Hellwig Nov. 19, 2024, 4:09 p.m. UTC
get_disk_ro and bdev_read_only return boolean conditions,
don't masquerade them as int.

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

Comments

John Garry Nov. 19, 2024, 4:37 p.m. UTC | #1
On 19/11/2024 16:09, Christoph Hellwig wrote:
> get_disk_ro and bdev_read_only return boolean conditions,
> don't masquerade them as int.
> 
> 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 957767c0cafd..f2c0868544a3 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -775,13 +775,13 @@  static inline void bdev_clear_flag(struct block_device *bdev, unsigned flag)
 	atomic_andnot(flag, &bdev->__bd_flags);
 }
 
-static inline int get_disk_ro(struct gendisk *disk)
+static inline bool get_disk_ro(struct gendisk *disk)
 {
 	return bdev_test_flag(disk->part0, BD_READ_ONLY) ||
 		test_bit(GD_READ_ONLY, &disk->state);
 }
 
-static inline int bdev_read_only(struct block_device *bdev)
+static inline bool bdev_read_only(struct block_device *bdev)
 {
 	return bdev_test_flag(bdev, BD_READ_ONLY) || get_disk_ro(bdev->bd_disk);
 }