[PATCH v5 04/27] arm64/sysreg: Add SYS_FIELD_GET() helper

Mark Brown broonie at kernel.org
Wed Jun 22 10:43:53 PDT 2022


Add a SYS_FIELD_GET() helper to match SYS_FIELD_PREP(), providing a
simplified interface to FIELD_GET() when using the generated defines
with standardized naming.

Signed-off-by: Mark Brown <broonie at kernel.org>
Acked-by: Mark Rutland <mark.rutland at arm.com>
---
 arch/arm64/include/asm/sysreg.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 6c7be1a2114b..0f5771ac5b94 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -1326,6 +1326,9 @@
 
 #endif
 
+#define SYS_FIELD_GET(reg, field, val)		\
+		 FIELD_GET(reg##_##field##_MASK, val)
+
 #define SYS_FIELD_PREP(reg, field, val)		\
 		 FIELD_PREP(reg##_##field##_MASK, val)
 
-- 
2.30.2




More information about the linux-arm-kernel mailing list