diff mbox series

NFS: make kobj_type structures constant

Message ID 20230210-kobj_type-nfs-v1-1-5078835dbb42@weissschuh.net (mailing list archive)
State New, archived
Headers show
Series NFS: make kobj_type structures constant | expand

Commit Message

Thomas Weißschuh Feb. 10, 2023, 2:17 a.m. UTC
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>
---
 fs/nfs/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: e544a07438522ab3688416e6e2e34bf0ee6d8755
change-id: 20230210-kobj_type-nfs-15c077fc25f2

Best regards,
diff mbox series

Patch

diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c
index 0cbcd2dfa732..791eaf42a8a1 100644
--- a/fs/nfs/sysfs.c
+++ b/fs/nfs/sysfs.c
@@ -31,7 +31,7 @@  static const struct kobj_ns_type_operations *nfs_netns_object_child_ns_type(
 	return &net_ns_type_operations;
 }
 
-static struct kobj_type nfs_netns_object_type = {
+static const struct kobj_type nfs_netns_object_type = {
 	.release = nfs_netns_object_release,
 	.sysfs_ops = &kobj_sysfs_ops,
 	.child_ns_type = nfs_netns_object_child_ns_type,
@@ -144,7 +144,7 @@  static struct attribute *nfs_netns_client_attrs[] = {
 };
 ATTRIBUTE_GROUPS(nfs_netns_client);
 
-static struct kobj_type nfs_netns_client_type = {
+static const struct kobj_type nfs_netns_client_type = {
 	.release = nfs_netns_client_release,
 	.default_groups = nfs_netns_client_groups,
 	.sysfs_ops = &kobj_sysfs_ops,