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 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 9001ECDB474 for ; Tue, 17 Oct 2023 00:51:36 +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=Ar0vYxPi5bLGYLiK50jRfiZObsOb38fE224fKbh4fl0=; b=sFslcuaBzyAjvK VMwbnDKImbB2p3xbQurJgrR9hQdmH8TMwvV1dLKI3lOHlLgFp/89q81vl0D8ISdVWxgkoAn0IzUCV FBQjDM25irpdjI6H2RtiDR/a1Lgsk49r1+p6udeiU94jm94bkx+GxQkDV5BaE8N1itKXlORNPvmyU GKkXVzTpxFtasIIcUsLmcd/DdHaHRhDuOkW/4V3M+dI/bs6GnP3qqc2sTZtIycHZgy+xBLIllWBcs RR8z1O9A9GHMUsJeIASzIMpnBmcf3AhWVJR/aqPw0z/6fC0NrFr1B+v8GW7UkdSry5Ma4/E0fJ3iS XWT0IalslE6acXPRtPlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsYIk-00AxBs-1S; Tue, 17 Oct 2023 00:51:14 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsYIg-00AxAf-0i for linux-arm-kernel@lists.infradead.org; Tue, 17 Oct 2023 00:51:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697503857; 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=NMSFN+3er1VhJvxYguaSdhyK/Ws3joAm+8CMiZVibniHNNg3Zq/W1OvTm0cmFNGanC+gh2 +XfVEJ3gyvSG6YzOpr3eWGwAnWtwuBMpmXv072+mAY4UtBf7idGDqZkPSoBdwdI4U0sfLL Ws1Wbz4MBrm0sGEtmJJOcojTyqDhil4= 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 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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231016_175110_714286_8C28F538 X-CRM114-Status: GOOD ( 12.46 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel