linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] arm64: constify aarch64_insn_encoding_class[]
Date: Wed, 14 Aug 2019 10:10:48 +0100	[thread overview]
Message-ID: <20190814091048.GL10425@arm.com> (raw)
In-Reply-To: <20190813141639.13476-3-mark.rutland@arm.com>

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 <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
>  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 <Dave.Martin@arm.com>

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-14  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 14:16 [PATCH 0/3] arm64: trivial constification patches Mark Rutland
2019-08-13 14:16 ` [PATCH 1/3] arm64: constify icache_policy_str[] Mark Rutland
2019-08-14  9:07   ` Dave Martin
2019-08-13 14:16 ` [PATCH 2/3] arm64: constify aarch64_insn_encoding_class[] Mark Rutland
2019-08-14  9:10   ` Dave Martin [this message]
2019-08-13 14:16 ` [PATCH 3/3] arm64: constify sys64_hook instances Mark Rutland
2019-08-14  9:12   ` Dave Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190814091048.GL10425@arm.com \
    --to=dave.martin@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).