Message ID | 20231017005036.334067-1-gshan@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3819223vqb; Mon, 16 Oct 2023 17:52:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENnWN4iK3CY2A99/N2uOikIZBEQd1nYHojuXvvNlrs0TFQwwu5vVwryMDP0mVpJlKG+4Xs X-Received: by 2002:a05:6808:183:b0:3ad:f3c0:5da3 with SMTP id w3-20020a056808018300b003adf3c05da3mr939550oic.3.1697503922607; Mon, 16 Oct 2023 17:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697503922; cv=none; d=google.com; s=arc-20160816; b=UexWjw3MlPO6WTVXq+Ov3xXYe7aJSpdxvzNjVj0OLdzwZ4AxGfLrvFrDNiHYb4uZOk LuUAEEqMREEFQae6j+OlwWgVaO9kF3eYvEvGPBJhmAUYv3SJDUMErnBbyi/veP4l/IJP IDyQomjF1VtZbXCDCuTeFw4hk/QlgUZcU6XpfvXs7jD8bkxFCwm2m0bDn6uiIFQp88dZ nCxGCe1i2eVh/4qqT4uumMDAvg/sPlmgiO3TJZ24chjLGzvpqf5CHzUcHInN/BNxPhlH kmX9GGqEiP2BKpjpc+IE1t8TTnMtAd47xWfrwf4l/iIOEtza9p8xomKwaP9oIKa+3OVR l/yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GO2d9NWO0GoUyOwGcMRCtNHLdBdqp9AanbpVwqLlSTc=; fh=bxjvu/js9n22SEQyM6D5HbShV4KMkd4r4gemxH5B9TA=; b=JWtyw5jb4ExKIt+5jO9nkch/3v3QgJbYTVbX0PsQ2xqnJnvdt5Yj0o57xrJs4JdQta LcBO44BQKvfFlr/K9P2xKZ3MthQpb/o7or07a5ZCDRPFkk8Lgbs3nTcSmER9hU/B3kel +OTDHf+mCxSuUZe9OFWlbKjSK/Bg5HK1vxFni3WV6Fhp9f7QfsAZn9IES0XybJmZQ8Mr YSfW66KfQ4cPqYs6gJQX6FQreRjcWnP14CssSJsgiSZR7yuUzdhutg0yvNebrLLQAfUz +GcfrvZeGvreW5mVkHTrH4viaDGKA1+4rVxBhSMmy0Edc6dFZbSVHIh6iew8MVcTsgii CrLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RZesrRwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id 201-20020a6302d2000000b005ad5178d053si22581pgc.347.2023.10.16.17.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RZesrRwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6B2E280D07F0; Mon, 16 Oct 2023 17:52:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234286AbjJQAvt (ORCPT <rfc822;hjfbswb@gmail.com> + 18 others); Mon, 16 Oct 2023 20:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233590AbjJQAvr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 16 Oct 2023 20:51:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0993D9B for <linux-kernel@vger.kernel.org>; Mon, 16 Oct 2023 17:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697503858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GO2d9NWO0GoUyOwGcMRCtNHLdBdqp9AanbpVwqLlSTc=; b=RZesrRwlH2dF4gHlSlF9TG4yKslLjYP2ziajUwLWas6E/S+NE/dtkgODNozjUjzN4Wtw+Y fl0HKo9vkCrQIMaJ1OaT/pi9iKQ4RQyoe/dC7fZmFI4Z5jnmgxjcAjpuVObLj8P8fH0Emd cZ1u4oWPI8D8JuzLEik3fDBPtFpiyaU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-VaYN-kyEOza8WvxkLKatPQ-1; Mon, 16 Oct 2023 20:50:53 -0400 X-MC-Unique: VaYN-kyEOza8WvxkLKatPQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08672185A790; Tue, 17 Oct 2023 00:50:53 +0000 (UTC) Received: from gshan.redhat.com (unknown [10.64.136.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 647F640C6F79; Tue, 17 Oct 2023 00:50:50 +0000 (UTC) From: Gavin Shan <gshan@redhat.com> To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, suzuki.poulose@arm.com, anshuman.khandual@arm.com, shan.gavin@gmail.com Subject: [PATCH] arm64: Remove system_uses_lse_atomics() Date: Tue, 17 Oct 2023 10:50:36 +1000 Message-ID: <20231017005036.334067-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 17:52:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779961872928533182 X-GMAIL-MSGID: 1779961872928533182 |
Series |
arm64: Remove system_uses_lse_atomics()
|
|
Commit Message
Gavin Shan
Oct. 17, 2023, 12:50 a.m. UTC
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 <gshan@redhat.com>
---
arch/arm64/include/asm/lse.h | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
Comments
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 <gshan@redhat.com> I had meant to remove this already, so: Acked-by: Mark Rutland <mark.rutland@arm.com> 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 <asm/atomic_lse.h> > #include <asm/cpucaps.h> > > -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 >
On Tue, 17 Oct 2023 10:50:36 +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. > > [...] Applied to arm64 (for-next/misc), thanks! [1/1] arm64: Remove system_uses_lse_atomics() https://git.kernel.org/arm64/c/0899a6278a86
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 <asm/atomic_lse.h> #include <asm/cpucaps.h> -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