From: Christoph Hellwig Date: Fri, 27 Oct 2023 05:34:08 +0000 (+0200) Subject: block: dev_t components are unsigned X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fdev_t-unsigned;p=users%2Fhch%2Fblock.git block: dev_t components are unsigned ... thus mark the major, first_minor and minors fields in struct gendisk as such. Signed-off-by: Christoph Hellwig --- diff --git a/block/genhd.c b/block/genhd.c index cc32a0c704eb..ceeb30518db6 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 eef450f25982..3ecf928d6325 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 */