Skip to content

Commit 3cb0c3b

Browse files
petrpavlusamitolvanen
authored andcommitted
params: Replace __modinit with __init_or_module
Remove the custom __modinit macro from kernel/params.c and instead use the common __init_or_module macro from include/linux/module.h. Both provide the same functionality. Signed-off-by: Petr Pavlu <petr.pavlu@suse.com> Reviewed-by: Aaron Tomlin <atomlin@atomlin.com> Reviewed-by: Daniel Gomez <da.gomez@samsung.com> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
1 parent f13bff1 commit 3cb0c3b

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

kernel/params.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,6 @@ static ssize_t param_attr_store(const struct module_attribute *mattr,
596596
}
597597
#endif
598598

599-
#ifdef CONFIG_MODULES
600-
#define __modinit
601-
#else
602-
#define __modinit __init
603-
#endif
604-
605599
#ifdef CONFIG_SYSFS
606600
void kernel_param_lock(struct module *mod)
607601
{
@@ -626,9 +620,9 @@ EXPORT_SYMBOL(kernel_param_unlock);
626620
* create file in sysfs. Returns an error on out of memory. Always cleans up
627621
* if there's an error.
628622
*/
629-
static __modinit int add_sysfs_param(struct module_kobject *mk,
630-
const struct kernel_param *kp,
631-
const char *name)
623+
static __init_or_module int add_sysfs_param(struct module_kobject *mk,
624+
const struct kernel_param *kp,
625+
const char *name)
632626
{
633627
struct module_param_attrs *new_mp;
634628
struct attribute **new_attrs;
@@ -761,7 +755,8 @@ void destroy_params(const struct kernel_param *params, unsigned num)
761755
params[i].ops->free(params[i].arg);
762756
}
763757

764-
struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
758+
struct module_kobject * __init_or_module
759+
lookup_or_create_module_kobject(const char *name)
765760
{
766761
struct module_kobject *mk;
767762
struct kobject *kobj;

0 commit comments

Comments
 (0)