[PATCH v1 03/17] arm64/sysreg: Add SYS_FIELD_GET() helper

Mark Rutland mark.rutland at arm.com
Tue Jun 7 03:18:30 PDT 2022


On Mon, Jun 06, 2022 at 09:12:40PM +0100, Mark Brown wrote:
> 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>

Mark.

> ---
>  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 4f5685d9a31b..9a5c63cb734b 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