mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
driver core: make kobj_type structures constant
Since commit ee6d3dd4ed ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dda6b81f17
commit
c83d9ab42f
@@ -760,7 +760,7 @@ static void software_node_release(struct kobject *kobj)
|
||||
kfree(swnode);
|
||||
}
|
||||
|
||||
static struct kobj_type software_node_type = {
|
||||
static const struct kobj_type software_node_type = {
|
||||
.release = software_node_release,
|
||||
.sysfs_ops = &kobj_sysfs_ops,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user