Skip to content

Commit d67307b

Browse files
t-8chamschuma-ntap
authored andcommitted
SUNRPC: make kobj_type structures constant
Since commit ee6d3dd ("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 <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent b46d80b commit d67307b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/sunrpc/sysfs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rpc_sysfs_object_child_ns_type(const struct kobject *kobj)
3636
return &net_ns_type_operations;
3737
}
3838

39-
static struct kobj_type rpc_sysfs_object_type = {
39+
static const struct kobj_type rpc_sysfs_object_type = {
4040
.release = rpc_sysfs_object_release,
4141
.sysfs_ops = &kobj_sysfs_ops,
4242
.child_ns_type = rpc_sysfs_object_child_ns_type,
@@ -427,20 +427,20 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
427427
};
428428
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
429429

430-
static struct kobj_type rpc_sysfs_client_type = {
430+
static const struct kobj_type rpc_sysfs_client_type = {
431431
.release = rpc_sysfs_client_release,
432432
.sysfs_ops = &kobj_sysfs_ops,
433433
.namespace = rpc_sysfs_client_namespace,
434434
};
435435

436-
static struct kobj_type rpc_sysfs_xprt_switch_type = {
436+
static const struct kobj_type rpc_sysfs_xprt_switch_type = {
437437
.release = rpc_sysfs_xprt_switch_release,
438438
.default_groups = rpc_sysfs_xprt_switch_groups,
439439
.sysfs_ops = &kobj_sysfs_ops,
440440
.namespace = rpc_sysfs_xprt_switch_namespace,
441441
};
442442

443-
static struct kobj_type rpc_sysfs_xprt_type = {
443+
static const struct kobj_type rpc_sysfs_xprt_type = {
444444
.release = rpc_sysfs_xprt_release,
445445
.default_groups = rpc_sysfs_xprt_groups,
446446
.sysfs_ops = &kobj_sysfs_ops,

0 commit comments

Comments
 (0)