From nobody Sun Feb 8 14:41:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 115831CFEBD; Tue, 3 Sep 2024 04:00:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725336034; cv=none; b=DTvEv9p/PSDt7KpsfIUR3+lGPEMf9eX1sQTBHM1vW8no39FvynLDgIAca7yHM5sMZsxqJiV9DvBVXIjrcAb8ZhI7H/OuyUEdsxTt5c5ymP4fkoH5IsAQf7s+QrHjmbFu8QqIKi+mNEKw8h2bXo5NOnNykWctUUOlqZsPDTipfvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725336034; c=relaxed/simple; bh=BQEb3OPU43WZ4vRis1H8WUXjg0vebOt0ENV2ilISPVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UlZx8lnyisU6CpKdxa/WPbJ48KxstksfzLQrCjoVoNJx55HBrVyib3xMoemmOW+OPhIOV9bHX3fJH9ifdob5MGVS4jsRGBC+soDSSH35PGTXKmQwtHfTpNzPtP/Db8HI4PkacU9dtm0NcC1yWBSW4bVP2TNmM4XUadgqfGmhYAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qge5XARI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qge5XARI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35F3FC4CEC5; Tue, 3 Sep 2024 04:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725336032; bh=BQEb3OPU43WZ4vRis1H8WUXjg0vebOt0ENV2ilISPVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qge5XARI/yOoOY6J1JgB2tTtfvKuivdFfE6B8iqOBP4UyMZ4ilV5hwnA2Gd8TC8w+ OS1JMJ0fEELc1T15Z4VpH1eMSEsAEmE6LQGVx4GQIiLhsA9RMzIps8/RMuSaSPLK38 eyuTWIoq9Gr/WtiTCwqcJTcLORwO8VFlJjxG+NwNAoOtsyo35syb+7Ml1FNj0W6Jqh NeT2rGF1XC+s6595wFniyPWEosh37VUm5nAdlqEWjUe6oIvw9th8nVZYM741vd0ci2 VeosnEoFofdwLgPPU3sGUJVba9lq/j4+aWS3rBrtl5G1PQUi6dDxnD4kAEMSl5HwM7 ndPY+tr0juzLA== From: Josh Poimboeuf To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Miroslav Benes , Petr Mladek , Joe Lawrence , Jiri Kosina , Peter Zijlstra , Marcos Paulo de Souza , Song Liu Subject: [RFC 07/31] kbuild: Remove "kmod" prefix from __KBUILD_MODNAME Date: Mon, 2 Sep 2024 20:59:50 -0700 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove the arbitrary "kmod" prefix from __KBUILD_MODNAME and add it back manually in the __initcall_id() macro. This makes it more consistent, now __KBUILD_MODNAME is just the non-stringified version of KBUILD_MODNAME. It will come in handy for the upcoming "objtool klp diff". Signed-off-by: Josh Poimboeuf --- include/linux/init.h | 3 ++- scripts/Makefile.lib | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/init.h b/include/linux/init.h index 58cef4c2e59a..b1921f4a7b7e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -206,12 +206,13 @@ extern struct module __this_module; =20 /* Format: ____ */ #define __initcall_id(fn) \ + __PASTE(kmod_, \ __PASTE(__KBUILD_MODNAME, \ __PASTE(__, \ __PASTE(__COUNTER__, \ __PASTE(_, \ __PASTE(__LINE__, \ - __PASTE(_, fn)))))) + __PASTE(_, fn))))))) =20 /* Format: ____ */ #define __initcall_name(prefix, __iid, id) \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9f06f6aaf7fc..8411e3d53938 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -130,7 +130,7 @@ name-fix-token =3D $(subst $(comma),_,$(subst -,_,$1)) name-fix =3D $(call stringify,$(call name-fix-token,$1)) basename_flags =3D -DKBUILD_BASENAME=3D$(call name-fix,$(basetarget)) modname_flags =3D -DKBUILD_MODNAME=3D$(call name-fix,$(modname)) \ - -D__KBUILD_MODNAME=3Dkmod_$(call name-fix-token,$(modname)) + -D__KBUILD_MODNAME=3D$(call name-fix-token,$(modname)) modfile_flags =3D -DKBUILD_MODFILE=3D$(call stringify,$(modfile)) =20 _c_flags =3D $(filter-out $(CFLAGS_REMOVE_$(target-stem).o), \ --=20 2.45.2