* [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers
@ 2021-07-16 5:58 Shaokun Zhang
2021-07-30 12:03 ` Will Deacon
2021-07-30 18:01 ` Catalin Marinas
0 siblings, 2 replies; 3+ messages in thread
From: Shaokun Zhang @ 2021-07-16 5:58 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Shaokun Zhang, Catalin Marinas, Will Deacon, Marc Zyngier
Use defined macro to simplify the code and make it more readable.
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>
---
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
_______________________________________________
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
* Re: [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers
2021-07-16 5:58 [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers Shaokun Zhang
@ 2021-07-30 12:03 ` Will Deacon
2021-07-30 18:01 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-07-30 12:03 UTC (permalink / raw)
To: Shaokun Zhang; +Cc: linux-arm-kernel, Catalin Marinas, Marc Zyngier
On Fri, Jul 16, 2021 at 01:58:09PM +0800, Shaokun Zhang wrote:
> Use defined macro to simplify the code and make it more readable.
>
> 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>
> ---
> 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));
Acked-by: Will Deacon <will@kernel.org>
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers
2021-07-16 5:58 [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers Shaokun Zhang
2021-07-30 12:03 ` Will Deacon
@ 2021-07-30 18:01 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2021-07-30 18:01 UTC (permalink / raw)
To: linux-arm-kernel, Shaokun Zhang; +Cc: Will Deacon, Marc Zyngier
On Fri, 16 Jul 2021 13:58:09 +0800, Shaokun Zhang wrote:
> Use defined macro to simplify the code and make it more readable.
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64: cpufeature: Use defined macro instead of magic numbers
https://git.kernel.org/arm64/c/ff85f10ba8e4
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-30 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 5:58 [PATCH v2] arm64: cpufeature: Use defined macro instead of magic numbers Shaokun Zhang
2021-07-30 12:03 ` Will Deacon
2021-07-30 18:01 ` Catalin Marinas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.