block: constify struct part_type part_type
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 30 May 2023 17:09:58 +0000 (19:09 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 30 May 2023 17:12:43 +0000 (11:12 -0600)
The struct is never modified so it can be const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20230419-const-partition-v3-2-4e14e48be367@weissschuh.net
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/core.c
include/linux/blkdev.h

index 650603d..2bc2106 100644 (file)
@@ -256,7 +256,7 @@ static int part_uevent(const struct device *dev, struct kobj_uevent_env *env)
        return 0;
 }
 
-struct device_type part_type = {
+const struct device_type part_type = {
        .name           = "partition",
        .groups         = part_attr_groups,
        .release        = part_release,
index b2ac587..d89c2da 100644 (file)
@@ -41,7 +41,7 @@ struct blk_stat_callback;
 struct blk_crypto_profile;
 
 extern const struct device_type disk_type;
-extern struct device_type part_type;
+extern const struct device_type part_type;
 extern struct class block_class;
 
 /*