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 76BFBC48BF6 for ; Thu, 29 Feb 2024 11:11:04 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hMpEMLAYFlpnCGgTqIwA8bTZW5QLWPxlmXozjn//+u4=; b=HCZRvGlJrP2B3B IwN0VSEtKe3tTC0eEI8hxNeE6dJwRWweOSVpWeCWby7lYykWBC43frOFXO9rZqWM6HXYWK6ArYQ8x 2Wp6inGws2KQT62+zpzwYoHW6RZI0Akqm1hXzcydAWvCClWinRlqOEqs172u7OR2Ak5P3mMHUw5M4 B3Y6cA8g4F8ogkYkyYWHBxYBbB79AJTB+HaeWHmHGL0mwYzB5bMU1dCIOLGkJ4tGUaMJle4jp7l1/ GA+WPSXX6LCAdnEswfSwVStpo/TeMyjIakhK1pM9n+f+8bdY6cHfqWvt/KwsFyTq5ajG/i4dozMXK BQ+a7z9SyE6bD4TqEbhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfeJK-0000000DIPj-34kD; Thu, 29 Feb 2024 11:10:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfeJI-0000000DIPO-1cun for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 11:10:45 +0000 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 3D16A1FB; Thu, 29 Feb 2024 03:11:21 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.67.138]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 617D63F762; Thu, 29 Feb 2024 03:10:40 -0800 (PST) Date: Thu, 29 Feb 2024 11:10:37 +0000 From: Mark Rutland To: Liao Chang Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org, maz@kernel.org, joey.gouly@arm.com, kristina.martsenko@arm.com, ryan.roberts@arm.com, jeremy.linton@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: cpufeatures: Clean up temporary variable to simplify code Message-ID: References: <20240229105208.456704-1-liaochang1@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240229105208.456704-1-liaochang1@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_031044_486004_671768F3 X-CRM114-Status: GOOD ( 17.42 ) 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 On Thu, Feb 29, 2024 at 10:52:08AM +0000, Liao Chang wrote: > Clean up one temporary variable to simplifiy code in capability > detection. > > Signed-off-by: Liao Chang This looks line a nice cleanup, so: Acked-by: Mark Rutland For context, we removed the last other user of 'num' in commit: 21fb26bfb01ffe0d ("arm64: alternatives: add alternative_has_feature_*()") Mark. > --- > arch/arm64/kernel/cpufeature.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 8d1a634a403e..0e900b23f7ab 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -3052,13 +3052,9 @@ static void __init enable_cpu_capabilities(u16 scope_mask) > boot_scope = !!(scope_mask & SCOPE_BOOT_CPU); > > for (i = 0; i < ARM64_NCAPS; i++) { > - unsigned int num; > - > caps = cpucap_ptrs[i]; > - if (!caps || !(caps->type & scope_mask)) > - continue; > - num = caps->capability; > - if (!cpus_have_cap(num)) > + if (!caps || !(caps->type & scope_mask) || > + !cpus_have_cap(caps->capability)) > continue; > > if (boot_scope && caps->cpu_enable) > -- > 2.34.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel