mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
SUNRPC: 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>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
b46d80bd2d
commit
d67307b414
1 changed files with 4 additions and 4 deletions
|
@ -36,7 +36,7 @@ rpc_sysfs_object_child_ns_type(const struct kobject *kobj)
|
||||||
return &net_ns_type_operations;
|
return &net_ns_type_operations;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct kobj_type rpc_sysfs_object_type = {
|
static const struct kobj_type rpc_sysfs_object_type = {
|
||||||
.release = rpc_sysfs_object_release,
|
.release = rpc_sysfs_object_release,
|
||||||
.sysfs_ops = &kobj_sysfs_ops,
|
.sysfs_ops = &kobj_sysfs_ops,
|
||||||
.child_ns_type = rpc_sysfs_object_child_ns_type,
|
.child_ns_type = rpc_sysfs_object_child_ns_type,
|
||||||
|
@ -427,20 +427,20 @@ static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
|
||||||
};
|
};
|
||||||
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
|
ATTRIBUTE_GROUPS(rpc_sysfs_xprt_switch);
|
||||||
|
|
||||||
static struct kobj_type rpc_sysfs_client_type = {
|
static const struct kobj_type rpc_sysfs_client_type = {
|
||||||
.release = rpc_sysfs_client_release,
|
.release = rpc_sysfs_client_release,
|
||||||
.sysfs_ops = &kobj_sysfs_ops,
|
.sysfs_ops = &kobj_sysfs_ops,
|
||||||
.namespace = rpc_sysfs_client_namespace,
|
.namespace = rpc_sysfs_client_namespace,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct kobj_type rpc_sysfs_xprt_switch_type = {
|
static const struct kobj_type rpc_sysfs_xprt_switch_type = {
|
||||||
.release = rpc_sysfs_xprt_switch_release,
|
.release = rpc_sysfs_xprt_switch_release,
|
||||||
.default_groups = rpc_sysfs_xprt_switch_groups,
|
.default_groups = rpc_sysfs_xprt_switch_groups,
|
||||||
.sysfs_ops = &kobj_sysfs_ops,
|
.sysfs_ops = &kobj_sysfs_ops,
|
||||||
.namespace = rpc_sysfs_xprt_switch_namespace,
|
.namespace = rpc_sysfs_xprt_switch_namespace,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct kobj_type rpc_sysfs_xprt_type = {
|
static const struct kobj_type rpc_sysfs_xprt_type = {
|
||||||
.release = rpc_sysfs_xprt_release,
|
.release = rpc_sysfs_xprt_release,
|
||||||
.default_groups = rpc_sysfs_xprt_groups,
|
.default_groups = rpc_sysfs_xprt_groups,
|
||||||
.sysfs_ops = &kobj_sysfs_ops,
|
.sysfs_ops = &kobj_sysfs_ops,
|
||||||
|
|
Loading…
Add table
Reference in a new issue