summaryrefslogtreecommitdiff
path: root/kernel/params.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@kernel.org>2026-04-12 22:33:39 +0200
committerThomas Gleixner <tglx@kernel.org>2026-04-12 22:33:39 +0200
commit1655f6895a896eb632ca8a019259bc5d358a9712 (patch)
treed34ad546baeed14bede485773b1be28ab8e6a289 /kernel/params.c
parent7eaf8e32de5f4ed4defda6fff81749041bb9d23f (diff)
parent68ed094971b09ba530baf6f75cf1902df880a8d1 (diff)
Merge tag 'timers-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux into timers/clocksource
- Added the DT bindings for the compatible string 'fsl,imx25-epit' (Frank Li) - Made the rttm_cs variable static for the rtl otto timer driver (Krzysztof Kozlowski) - Fixed error return code handling in the sun5i timer driver (Chen Ni) - Made the timer-of and the mmio code compatible with modules (Daniel Lezcano) Link: https://lore.kernel.org/151feae1-39ba-4abd-a9f9-9bff377a2cd8@oss.qualcomm.com
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/kernel/params.c b/kernel/params.c
index b96cfd693c99..7188a12dbe86 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -596,12 +596,6 @@ static ssize_t param_attr_store(const struct module_attribute *mattr,
}
#endif
-#ifdef CONFIG_MODULES
-#define __modinit
-#else
-#define __modinit __init
-#endif
-
#ifdef CONFIG_SYSFS
void kernel_param_lock(struct module *mod)
{
@@ -626,9 +620,9 @@ EXPORT_SYMBOL(kernel_param_unlock);
* create file in sysfs. Returns an error on out of memory. Always cleans up
* if there's an error.
*/
-static __modinit int add_sysfs_param(struct module_kobject *mk,
- const struct kernel_param *kp,
- const char *name)
+static __init_or_module int add_sysfs_param(struct module_kobject *mk,
+ const struct kernel_param *kp,
+ const char *name)
{
struct module_param_attrs *new_mp;
struct attribute **new_attrs;
@@ -639,13 +633,12 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
if (!mk->mp) {
/* First allocation. */
- mk->mp = kzalloc(sizeof(*mk->mp), GFP_KERNEL);
+ mk->mp = kzalloc_obj(*mk->mp);
if (!mk->mp)
return -ENOMEM;
mk->mp->grp.name = "parameters";
/* NULL-terminated attribute array. */
- mk->mp->grp.attrs = kzalloc(sizeof(mk->mp->grp.attrs[0]),
- GFP_KERNEL);
+ mk->mp->grp.attrs = kzalloc_obj(mk->mp->grp.attrs[0]);
/* Caller will cleanup via free_module_param_attrs */
if (!mk->mp->grp.attrs)
return -ENOMEM;
@@ -761,7 +754,8 @@ void destroy_params(const struct kernel_param *params, unsigned num)
params[i].ops->free(params[i].arg);
}
-struct module_kobject __modinit * lookup_or_create_module_kobject(const char *name)
+struct module_kobject * __init_or_module
+lookup_or_create_module_kobject(const char *name)
{
struct module_kobject *mk;
struct kobject *kobj;
@@ -771,7 +765,7 @@ struct module_kobject __modinit * lookup_or_create_module_kobject(const char *na
if (kobj)
return to_module_kobject(kobj);
- mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
+ mk = kzalloc_obj(struct module_kobject);
if (!mk)
return NULL;