Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: cpufeatures: Clean up temporary variable to simplify code

Clean up one temporary variable to simplifiy code in capability
detection.

Signed-off-by: Liao Chang <liaochang1@huawei.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20240229105208.456704-1-liaochang1@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Liao Chang and committed by
Catalin Marinas
62244266 6d1ce806

+2 -6
+2 -6
arch/arm64/kernel/cpufeature.c
··· 3052 3052 boot_scope = !!(scope_mask & SCOPE_BOOT_CPU); 3053 3053 3054 3054 for (i = 0; i < ARM64_NCAPS; i++) { 3055 - unsigned int num; 3056 - 3057 3055 caps = cpucap_ptrs[i]; 3058 - if (!caps || !(caps->type & scope_mask)) 3059 - continue; 3060 - num = caps->capability; 3061 - if (!cpus_have_cap(num)) 3056 + if (!caps || !(caps->type & scope_mask) || 3057 + !cpus_have_cap(caps->capability)) 3062 3058 continue; 3063 3059 3064 3060 if (boot_scope && caps->cpu_enable)