diff mbox series

[2/2] block: dev_t components are unsigned

Message ID 20231030140106.1393384-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/2] ubi: block: don't use gendisk->first_minor for the idr_alloc return value | expand

Commit Message

Christoph Hellwig Oct. 30, 2023, 2:01 p.m. UTC
... thus mark the major, first_minor and minors fields in struct gendisk
as such.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/genhd.c          | 4 ++--
 include/linux/blkdev.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/block/genhd.c b/block/genhd.c
index cc32a0c704eb84..ceeb30518db696 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -180,7 +180,7 @@  void blkdev_show(struct seq_file *seqf, off_t offset)
 	spin_lock(&major_names_spinlock);
 	for (dp = major_names[major_to_index(offset)]; dp; dp = dp->next)
 		if (dp->major == offset)
-			seq_printf(seqf, "%3d %s\n", dp->major, dp->name);
+			seq_printf(seqf, "%3u %s\n", dp->major, dp->name);
 	spin_unlock(&major_names_spinlock);
 }
 #endif /* CONFIG_PROC_FS */
@@ -896,7 +896,7 @@  static ssize_t disk_range_show(struct device *dev,
 {
 	struct gendisk *disk = dev_to_disk(dev);
 
-	return sprintf(buf, "%d\n", disk->minors);
+	return sprintf(buf, "%u\n", disk->minors);
 }
 
 static ssize_t disk_ext_range_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index eef450f259828d..3ecf928d6325b6 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -130,9 +130,9 @@  struct gendisk {
 	 * major/first_minor/minors should not be set by any new driver, the
 	 * block core will take care of allocating them automatically.
 	 */
-	int major;
-	int first_minor;
-	int minors;
+	unsigned int major;
+	unsigned int first_minor;
+	unsigned int minors;
 
 	char disk_name[DISK_NAME_LEN];	/* name of major driver */