From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B12FACDB474 for ; Tue, 17 Oct 2023 10:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343590AbjJQKfx (ORCPT ); Tue, 17 Oct 2023 06:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbjJQKfu (ORCPT ); Tue, 17 Oct 2023 06:35:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 42587A2 for ; Tue, 17 Oct 2023 03:35:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 869872F4; Tue, 17 Oct 2023 03:36:28 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.68.232]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A2D843F762; Tue, 17 Oct 2023 03:35:46 -0700 (PDT) Date: Tue, 17 Oct 2023 11:35:44 +0100 From: Mark Rutland To: Gavin Shan Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, suzuki.poulose@arm.com, anshuman.khandual@arm.com, shan.gavin@gmail.com Subject: Re: [PATCH] arm64: Remove system_uses_lse_atomics() Message-ID: References: <20231017005036.334067-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231017005036.334067-1-gshan@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 17, 2023 at 10:50:36AM +1000, Gavin Shan wrote: > There are two variants of system_uses_lse_atomics(), depending on > CONFIG_ARM64_LSE_ATOMICS. The function isn't called anywhere when > CONFIG_ARM64_LSE_ATOMICS is disabled. It can be directly replaced > by alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS) when the kernel > option is enabled. > > No need to keep system_uses_lse_atomics() and just remove it. > > Signed-off-by: Gavin Shan I had meant to remove this already, so: Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/lse.h | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h > index cbbcdc35c4cd..3129a5819d0e 100644 > --- a/arch/arm64/include/asm/lse.h > +++ b/arch/arm64/include/asm/lse.h > @@ -16,14 +16,9 @@ > #include > #include > > -static __always_inline bool system_uses_lse_atomics(void) > -{ > - return alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS); > -} > - > #define __lse_ll_sc_body(op, ...) \ > ({ \ > - system_uses_lse_atomics() ? \ > + alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS) ? \ > __lse_##op(__VA_ARGS__) : \ > __ll_sc_##op(__VA_ARGS__); \ > }) > @@ -34,8 +29,6 @@ static __always_inline bool system_uses_lse_atomics(void) > > #else /* CONFIG_ARM64_LSE_ATOMICS */ > > -static inline bool system_uses_lse_atomics(void) { return false; } > - > #define __lse_ll_sc_body(op, ...) __ll_sc_##op(__VA_ARGS__) > > #define ARM64_LSE_ATOMIC_INSN(llsc, lse) llsc > -- > 2.41.0 >