arm64: cpufeature: Use defined macro instead of magic numbers
authorShaokun Zhang <zhangshaokun@hisilicon.com>
Fri, 16 Jul 2021 05:58:09 +0000 (13:58 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 30 Jul 2021 15:21:47 +0000 (16:21 +0100)
Use defined macro to simplify the code and make it more readable.

Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Link: https://lore.kernel.org/r/1626415089-57584-1-git-send-email-zhangshaokun@hisilicon.com
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/cpufeature.c

index 0ead8bf..2e4ec12 100644 (file)
@@ -1734,7 +1734,7 @@ static void cpu_has_fwb(const struct arm64_cpu_capabilities *__unused)
        u64 val = read_sysreg_s(SYS_CLIDR_EL1);
 
        /* Check that CLIDR_EL1.LOU{U,IS} are both 0 */
-       WARN_ON(val & (7 << 27 | 7 << 21));
+       WARN_ON(CLIDR_LOUU(val) || CLIDR_LOUIS(val));
 }
 
 #ifdef CONFIG_ARM64_PAN