From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4A243F88B5; Wed, 20 May 2026 18:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300082; cv=none; b=eLe5XbWH4i7RyxcNvr0X1hY36hJW1j3VbllwG1TLTIOmdClrmev6RK5gTFdpcG0xIoCr6mxwVfpXG3QmzwrIngm/UscA4G4iTyVpfl49sKPjSCJR8KFdkmZeawb/BVcb5ftXs0dT1vS8S9t8T+TCSNZebhO128BG4Fcn4/yEyYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300082; c=relaxed/simple; bh=+/m2jaKgOwC5N1VTIpmnxQ8YObtlqmq+iVh1fnh6FKg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g6ACitIzIlyZ+roC8LqLDUCBS4MTWE/XbKpZbpN2kWsQBLdXoJ+G0ISuRol/v0UXXvqVunDjAqPODNhLKB0pUMYkBprypNKWXS+v8olNtOcYh3R3bt9aTGwQlkLD9VnQ0YB6j0L51iSGhToua3FTUgc4cC2qJy6mzWpJ14ie9BQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NPqs67Ib; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NPqs67Ib" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B4241F00893; Wed, 20 May 2026 18:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779300079; bh=RkZba11OqC47P0zCQDWsevQJvbz+6NsH+K4VvYWSFsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NPqs67IbqLzDEyzK4oA7yR8j0mOdLKMR12gcGdVpfrzmemYN/GEoexskiLx2GhCpZ EvlvgyADWZvXvzcHTIDwMabdlIjpsxSFuTrXg9X2svP5fSpv4Fy0UaforO7Z/FLkwA bwUCkrJoJ5yQubc1hDZ5NIBMVuUDm82w1rnVoV6w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Petr Pavlu , Aaron Tomlin , Daniel Gomez , Sami Tolvanen , Sasha Levin Subject: [PATCH 6.12 040/666] params: Replace __modinit with __init_or_module Date: Wed, 20 May 2026 18:14:11 +0200 Message-ID: <20260520162112.107129846@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Petr Pavlu [ Upstream commit 3cb0c3bdea5388519bc1bf575dca6421b133302b ] 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 Reviewed-by: Aaron Tomlin Reviewed-by: Daniel Gomez Reviewed-by: Sami Tolvanen Signed-off-by: Sami Tolvanen Stable-dep-of: deffe1edba62 ("module: Fix freeing of charp module parameters when CONFIG_SYSFS=n") Signed-off-by: Sasha Levin --- kernel/params.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/kernel/params.c b/kernel/params.c index 9935ff599356b..2be5a083f9399 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -595,12 +595,6 @@ static ssize_t param_attr_store(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) { @@ -625,9 +619,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; @@ -763,7 +757,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; -- 2.53.0