summaryrefslogtreecommitdiffstats
path: root/block/blk-ia-ranges.c
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-02-08 04:01:22 +0000
committerJens Axboe <axboe@kernel.dk>2023-02-09 09:38:16 -0700
commit5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7 (patch)
tree8fc6f64b728435566204bb7c34ef900d5bae82c8 /block/blk-ia-ranges.c
parent23f3e3272e7a4d9fb870485cd6df1e4f9539282c (diff)
downloadlinux-stable-5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7.tar.gz
linux-stable-5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7.tar.bz2
linux-stable-5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7.zip
block: make kobj_type structures constant
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230208-kobj_type-block-v1-1-0b3eafd7d983@weissschuh.net Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-ia-ranges.c')
-rw-r--r--block/blk-ia-ranges.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-ia-ranges.c b/block/blk-ia-ranges.c
index 2141931ddd37..c9eb4241e048 100644
--- a/block/blk-ia-ranges.c
+++ b/block/blk-ia-ranges.c
@@ -75,7 +75,7 @@ static void blk_ia_range_sysfs_nop_release(struct kobject *kobj)
{
}
-static struct kobj_type blk_ia_range_ktype = {
+static const struct kobj_type blk_ia_range_ktype = {
.sysfs_ops = &blk_ia_range_sysfs_ops,
.default_groups = blk_ia_range_groups,
.release = blk_ia_range_sysfs_nop_release,
@@ -94,7 +94,7 @@ static void blk_ia_ranges_sysfs_release(struct kobject *kobj)
kfree(iars);
}
-static struct kobj_type blk_ia_ranges_ktype = {
+static const struct kobj_type blk_ia_ranges_ktype = {
.release = blk_ia_ranges_sysfs_release,
};