From: Thomas Weißschuh Date: Tue, 14 Feb 2023 04:23:11 +0000 (+0000) Subject: net: bridge: make kobj_type structure constant X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e8c6cbd7656e4cea9e2336a3a85bd609dd76eb3d;p=linux.git net: bridge: make kobj_type structure 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 definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski --- diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index ad13b48e3e08a..24f01ff113f0e 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -269,7 +269,7 @@ static void brport_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t net_ns_get_ownership(dev_net(p->dev), uid, gid); } -static struct kobj_type brport_ktype = { +static const struct kobj_type brport_ktype = { #ifdef CONFIG_SYSFS .sysfs_ops = &brport_sysfs_ops, #endif