]> www.infradead.org Git - users/hch/block.git/commitdiff
block: dev_t components are unsigned dev_t-unsigned
authorChristoph Hellwig <hch@lst.de>
Fri, 27 Oct 2023 05:34:08 +0000 (07:34 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 27 Oct 2023 05:36:28 +0000 (07:36 +0200)
... 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
include/linux/blkdev.h

index cc32a0c704eb846c2abba312494c7272f4c74520..ceeb30518db6965ef2c57778108d61c8d6bd2247 100644 (file)
@@ -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,
index eef450f259828d933f1f4b96d5515aed3d7eb3c5..3ecf928d6325b699e7b37a43ccc26426809a9ca0 100644 (file)
@@ -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 */