From patchwork Mon Oct 7 13:11:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rolf Eike Beer X-Patchwork-Id: 13824697 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 C3492CFB441 for ; Mon, 7 Oct 2024 13:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=bPhG2GIPDX4GAV2r/ngmGOsWeW72L9sRUfC99qdHhoI=; b=ZMtiQeDSWIjw4Hl4zy19IJdLs6 p/V2RhGSnbc/M+IT4KZVgrCYo/rlL79r5n2vXJ3Pc+oXcclj3S8aSsqCpnZxO57zI1Uf4VuvhHUlY mYu5gNHnn2KAOUPRHZM4BRnmA/S+NCskHyGaZxfTb2lrxdciOeuIMSq7Xp1MWVr4o/7br+ZzpYTKI TUwN7zpngoC6JRdDnWia/NfIS+0zWK3ibPXS3TFcIkeFSclFXiS9/YQaXY7H0QwQjuXFDCXyuN2Ct pWmy8Lamwf0iOhhVQalS2Wza/jNDnqSlVG9Tb6pU5/NUZhfhpRK3VVCnmq8CxgmY0YINY5nVEtarj dEogP98Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sxnzd-00000002YWl-0zDS; Mon, 07 Oct 2024 13:41:45 +0000 Received: from mx1.emlix.com ([178.63.209.131]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sxncm-00000002Tk8-1JIo for linux-arm-kernel@lists.infradead.org; Mon, 07 Oct 2024 13:18:10 +0000 Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id DE2925F863; Mon, 7 Oct 2024 15:11:40 +0200 (CEST) From: Rolf Eike Beer To: Russell King , Arnd Bergmann , Yuntao Liu , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm32: simplify ARM_MMU_KEEP usage Date: Mon, 07 Oct 2024 15:11:40 +0200 Message-ID: <2200295.irdbgypaU6@devpool47.emlix.com> Organization: emlix GmbH MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241007_061808_503921_6CFA12F3 X-CRM114-Status: GOOD ( 12.21 ) 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 All current users need to add a KEEP() around the argument so the value is actually kept, which doesn't feel very natural and is prone to upcoming bugs as the name suggests that this macro alone already keeps things. Move that directly into the definition. Signed-off-by: Rolf Eike Beer --- I'm unsure if ARM_MMU_DISCARD() needs the same treatment for the non-MMU case. I suspect noone has tried dead code elimination for non-MMU? arch/arm/include/asm/vmlinux.lds.h | 2 +- arch/arm/kernel/vmlinux-xip.lds.S | 2 +- arch/arm/kernel/vmlinux.lds.S | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h index d60f6e83a9f7..89697f204715 100644 --- a/arch/arm/include/asm/vmlinux.lds.h +++ b/arch/arm/include/asm/vmlinux.lds.h @@ -19,7 +19,7 @@ #endif #ifdef CONFIG_MMU -#define ARM_MMU_KEEP(x) x +#define ARM_MMU_KEEP(x) KEEP(x) #define ARM_MMU_DISCARD(x) #else #define ARM_MMU_KEEP(x) diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 5eddb75a7174..f2e8d4fac068 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -63,7 +63,7 @@ SECTIONS . = ALIGN(4); __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { __start___ex_table = .; - ARM_MMU_KEEP(KEEP(*(__ex_table))) + ARM_MMU_KEEP(*(__ex_table)) __stop___ex_table = .; } diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index de373c6c2ae8..d592a203f9c6 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -74,7 +74,7 @@ SECTIONS . = ALIGN(4); __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { __start___ex_table = .; - ARM_MMU_KEEP(KEEP(*(__ex_table))) + ARM_MMU_KEEP(*(__ex_table)) __stop___ex_table = .; }