[PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers
Shaokun Zhang
zhangshaokun at hisilicon.com
Thu Jul 15 22:58:09 PDT 2021
Use defined macro to simplify the code and make it more readable.
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
Cc: Marc Zyngier <maz at kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun at hisilicon.com>
---
ChangeLog:
v1-->v2:
1. Address Will's comment to make code more readable.
arch/arm64/kernel/cpufeature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 125d5c9471ac..93004bc8e1e8 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1733,7 +1733,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
--
2.7.4
More information about the linux-arm-kernel
mailing list