arm64/cpufeature: Use helper macro to specify ID register for capabilites
authorMark Brown <broonie@kernel.org>
Wed, 12 Apr 2023 17:13:31 +0000 (18:13 +0100)
committerWill Deacon <will@kernel.org>
Mon, 17 Apr 2023 13:06:39 +0000 (14:06 +0100)
commit863da0bdb17b5c9f093e042f655a84ea3f169d6b
treeb6ee183cd3fe9bce85e6954bffbca0c1211cd559
parent21642da214a9676727cd32b8e7f2906259502f00
arm64/cpufeature: Use helper macro to specify ID register for capabilites

When defining which value to look for in a system register field we
currently manually specify the register, field shift, width and sign and
the value to look for. This opens the potential for error with for example
the wrong field width or sign being specified, an enumeration value for
a different similarly named field or letting something be initialised to 0.

Since we now generate defines for all the ID registers we now have named
constants for all of these things generated from the system register
description, meaning that we can generate initialisation for all the fields
used in matching from a minimal specification of register, field and match
value. This is both shorter and eliminates or makes build failures several
potential errors.

No change in the generated binary.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230303-arm64-cpufeature-helpers-v2-3-4c8f28a6f203@kernel.org
[will: Drop explicit '.sign' assignment for BTI feature]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/cpufeature.c