diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-02-08 05:01:22 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-09 17:38:16 +0100 |
commit | 5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7 (patch) | |
tree | 8fc6f64b728435566204bb7c34ef900d5bae82c8 /block/elevator.c | |
parent | block: Merge bio before checking ->cached_rq (diff) | |
download | linux-5f6224175fbe4c2b91e303c17af4d4eb5e3a60a7.tar.xz linux-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/elevator.c')
-rw-r--r-- | block/elevator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/elevator.c b/block/elevator.c index adee58e48e2d..24909069f872 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -126,7 +126,7 @@ static struct elevator_type *elevator_find_get(struct request_queue *q, return e; } -static struct kobj_type elv_ktype; +static const struct kobj_type elv_ktype; struct elevator_queue *elevator_alloc(struct request_queue *q, struct elevator_type *e) @@ -455,7 +455,7 @@ static const struct sysfs_ops elv_sysfs_ops = { .store = elv_attr_store, }; -static struct kobj_type elv_ktype = { +static const struct kobj_type elv_ktype = { .sysfs_ops = &elv_sysfs_ops, .release = elevator_release, }; |