aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 8d95f5451b22..0b30ecd53a52 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -401,8 +401,8 @@ int param_get_string(char *buffer, struct kernel_param *kp)
401} 401}
402 402
403/* sysfs output in /sys/modules/XYZ/parameters/ */ 403/* sysfs output in /sys/modules/XYZ/parameters/ */
404#define to_module_attr(n) container_of(n, struct module_attribute, attr); 404#define to_module_attr(n) container_of(n, struct module_attribute, attr)
405#define to_module_kobject(n) container_of(n, struct module_kobject, kobj); 405#define to_module_kobject(n) container_of(n, struct module_kobject, kobj)
406 406
407extern struct kernel_param __start___param[], __stop___param[]; 407extern struct kernel_param __start___param[], __stop___param[];
408 408
@@ -420,7 +420,7 @@ struct module_param_attrs
420}; 420};
421 421
422#ifdef CONFIG_SYSFS 422#ifdef CONFIG_SYSFS
423#define to_param_attr(n) container_of(n, struct param_attribute, mattr); 423#define to_param_attr(n) container_of(n, struct param_attribute, mattr)
424 424
425static ssize_t param_attr_show(struct module_attribute *mattr, 425static ssize_t param_attr_show(struct module_attribute *mattr,
426 struct module *mod, char *buf) 426 struct module *mod, char *buf)
@@ -516,6 +516,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
516 new->grp.attrs = attrs; 516 new->grp.attrs = attrs;
517 517
518 /* Tack new one on the end. */ 518 /* Tack new one on the end. */
519 sysfs_attr_init(&new->attrs[num].mattr.attr);
519 new->attrs[num].param = kp; 520 new->attrs[num].param = kp;
520 new->attrs[num].mattr.show = param_attr_show; 521 new->attrs[num].mattr.show = param_attr_show;
521 new->attrs[num].mattr.store = param_attr_store; 522 new->attrs[num].mattr.store = param_attr_store;
@@ -722,7 +723,7 @@ static ssize_t module_attr_store(struct kobject *kobj,
722 return ret; 723 return ret;
723} 724}
724 725
725static struct sysfs_ops module_sysfs_ops = { 726static const struct sysfs_ops module_sysfs_ops = {
726 .show = module_attr_show, 727 .show = module_attr_show,
727 .store = module_attr_store, 728 .store = module_attr_store,
728}; 729};
@@ -736,7 +737,7 @@ static int uevent_filter(struct kset *kset, struct kobject *kobj)
736 return 0; 737 return 0;
737} 738}
738 739
739static struct kset_uevent_ops module_uevent_ops = { 740static const struct kset_uevent_ops module_uevent_ops = {
740 .filter = uevent_filter, 741 .filter = uevent_filter,
741}; 742};
742 743