diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-02-05 01:36:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-02-08 15:34:30 +0300 |
commit | c83d9ab42f1ef70d81bb3c637a12c098a9a05057 (patch) | |
tree | 501a3f7ca5f3a66ac4c16a617035941e118d84af /drivers/base/bus.c | |
parent | dda6b81f17ad8e72f8bc151c876cd335a471e268 (diff) | |
download | linux-c83d9ab42f1ef70d81bb3c637a12c098a9a05057.tar.xz |
driver core: 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/20230204-kobj_type-driver-core-v1-1-b9f809419f2c@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index aa70b3a7d778..d6b4a5d5a43c 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -91,7 +91,7 @@ static void driver_release(struct kobject *kobj) kfree(drv_priv); } -static struct kobj_type driver_ktype = { +static const struct kobj_type driver_ktype = { .sysfs_ops = &driver_sysfs_ops, .release = driver_release, }; @@ -159,7 +159,7 @@ static void bus_release(struct kobject *kobj) bus->p = NULL; } -static struct kobj_type bus_ktype = { +static const struct kobj_type bus_ktype = { .sysfs_ops = &bus_sysfs_ops, .release = bus_release, }; |