Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: cpufeature: Use defined macro instead of magic numbers
@ 2021-07-14  6:13 Shaokun Zhang
  2021-07-15 16:31 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Shaokun Zhang @ 2021-07-14  6:13 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Shaokun Zhang, Catalin Marinas, Will Deacon, Marc Zyngier

Macro 'CLIDR_LOUU_SHIFT' and 'CLIDR_LOUIS_SHIFT' are defined, so use
these to replace the magic numbers.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
 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..4ee3496bcff8 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(val & (7 << CLIDR_LOUU_SHIFT | 7 << CLIDR_LOUIS_SHIFT));
 }
 
 #ifdef CONFIG_ARM64_PAN
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-16  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-14  6:13 [PATCH] arm64: cpufeature: Use defined macro instead of magic numbers Shaokun Zhang
2021-07-15 16:31 ` Will Deacon
2021-07-16  1:09   ` Shaokun Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox