[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZeBmLc9bLhT5qfrB@FVFF77S0Q05N>
Date: Thu, 29 Feb 2024 11:10:37 +0000
From: Mark Rutland <mark.rutland@....com>
To: Liao Chang <liaochang1@...wei.com>
Cc: catalin.marinas@....com, will@...nel.org, broonie@...nel.org,
maz@...nel.org, joey.gouly@....com, kristina.martsenko@....com,
ryan.roberts@....com, jeremy.linton@....com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: cpufeatures: Clean up temporary variable to
simplify code
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 <liaochang1@...wei.com>
This looks line a nice cleanup, so:
Acked-by: Mark Rutland <mark.rutland@....com>
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
>
Powered by blists - more mailing lists