Subject: Re: [PATCH 2/3] arm64: constify aarch64_insn_encoding_class[]

From: Dave Martin <[email-masked]>
Date: Wed, 14 Aug 2019 10:10:48 +0100

On Tue, Aug 13, 2019 at 03:16:38PM +0100, Mark Rutland wrote:
> The aarch64_insn_encoding_class[] array contains compile-time constant
> data, and is never intentionally modified, so let's mark it as const.
> 
> Signed-off-by: Mark Rutland <[email-masked]>
> Cc: Catalin Marinas <[email-masked]>
> Cc: Will Deacon <[email-masked]>
> ---
>  arch/arm64/kernel/insn.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
> index 84b059ed04fc..d801a7094076 100644
> --- a/arch/arm64/kernel/insn.c
> +++ b/arch/arm64/kernel/insn.c
> @@ -26,7 +26,7 @@
>  #define AARCH64_INSN_N_BIT	BIT(22)
>  #define AARCH64_INSN_LSL_12	BIT(22)
>  
> -static int aarch64_insn_encoding_class[] = {
> +static const int aarch64_insn_encoding_class[] = {
>  	AARCH64_INSN_CLS_UNKNOWN,
>  	AARCH64_INSN_CLS_UNKNOWN,
>  	AARCH64_INSN_CLS_UNKNOWN,

This is an implementation detail of aarch64_get_insn_class(), so it
could be moved inside there, or rewritten as a switch.  It works as-is
though.

Either way,

Reviewed-by: Dave Martin <[email-masked]>

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel