From patchwork Fri Dec 2 16:18:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13062918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0FF0C4321E for ; Fri, 2 Dec 2022 16:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PdtQIPe84vP0Ktbq+06QOvmnpQWZtJPdsXTGaAnen2s=; b=SroXKew2EWQNfc HZ2DX0lykKCiIsW/E63ZrwzPT0o0uaGo4ND7Yg1QLayqFzo6cLp5CxUwGwliZn22Hhb4UWGHD+zHV n3OFJzrGx9h2/ouDgxuMleS5CBxEfs1bmtlEd3Z2mVSu9GOrMvrzzz+4pxCoLq1yfF4VGqd4Gw0ya fzk785E+MusuM8NaHiWIJKDy/OZ4wZFyGC7fMig6hManNSTu+kl2xfPGRBBEP4Fk8my7zNHZEBoZ3 CJ9yzRilaRo5dV0TtI6zp1Xwptnn96sAFo/xUp2abG6/B4P/4c+K+dxEGy+JdeOPXLiCwX5nUB759 pYAMGlTbowxsuMw2J8SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p18uO-00HXY3-AS; Fri, 02 Dec 2022 16:29:04 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p18uJ-00HXTr-2T for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 16:29:00 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 29CA2B821E6; Fri, 2 Dec 2022 16:28:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 646A1C433D6; Fri, 2 Dec 2022 16:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669998533; bh=Pf5oJxPaCUXq/MkhRqDLU0HC91yoKf1DriJwDt3OALM=; h=From:To:Cc:Subject:Date:From; b=WpN3dhvsWIVma3mtdFNwqxTtzR1iHcliaUFUS0MIqbHWVzge1Opp/87bf8+FuVd0T /732mCB94RIpT3sPcSXSYvpxZKGoeIGEYoqXyFPQGoLYx610+Ool3UWImR7YvOy0nV uPurKJq5Dq7zpCzdRp1fga2hhoQf3KsuYPE9sIDVmlBasjf3jJsNpObyMkD1ITgogS lyqop2jfdSqjPf1slX0znpToHjExOBfR1knJwpBBcHY+en+SL5Ddccov/lCZMjY3yq MWTRkuLWFeP3NT2M2ic9co9+shoXj5/EsvK0wR9EmSRB/QNcyJRDJeOJuwsF7RRlUB KXfPE3l7RER3Q== From: Jisheng Zhang To: Catalin Marinas , Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH next] arm64: alternatives: add __init/__initconst to some functions/variables Date: Sat, 3 Dec 2022 00:18:59 +0800 Message-Id: <20221202161859.2228-1-jszhang@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_082859_306522_AD8F5866 X-CRM114-Status: GOOD ( 14.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org apply_alternatives_vdso(), __apply_alternatives_multi_stop() and kernel_alternatives are not needed after booting, so mark the two functions as __init and the var as __initconst. Signed-off-by: Jisheng Zhang --- arch/arm64/kernel/alternative.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c index 0f5eaa4c3a39..d32d4ed5519b 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c @@ -196,7 +196,7 @@ static void __apply_alternatives(const struct alt_region *region, } } -static void apply_alternatives_vdso(void) +static void __init apply_alternatives_vdso(void) { struct alt_region region; const struct elf64_hdr *hdr; @@ -220,7 +220,7 @@ static void apply_alternatives_vdso(void) __apply_alternatives(®ion, false, &all_capabilities[0]); } -static const struct alt_region kernel_alternatives = { +static const struct alt_region kernel_alternatives __initconst = { .begin = (struct alt_instr *)__alt_instructions, .end = (struct alt_instr *)__alt_instructions_end, }; @@ -229,7 +229,7 @@ static const struct alt_region kernel_alternatives = { * We might be patching the stop_machine state machine, so implement a * really simple polling protocol here. */ -static int __apply_alternatives_multi_stop(void *unused) +static int __init __apply_alternatives_multi_stop(void *unused) { /* We always have a CPU 0 at this point (__init) */ if (smp_processor_id()) {