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 1/3] arm64: constify icache_policy_str[]
Date: Wed, 14 Aug 2019 10:07:10 +0100 [thread overview]
Message-ID: <20190814090709.GK10425@arm.com> (raw)
In-Reply-To: <20190813141639.13476-2-mark.rutland@arm.com>
On Tue, Aug 13, 2019 at 03:16:37PM +0100, Mark Rutland wrote:
> The icache_policy_str[] 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/cpuinfo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> index 876055e37352..05933c065732 100644
> --- a/arch/arm64/kernel/cpuinfo.c
> +++ b/arch/arm64/kernel/cpuinfo.c
> @@ -33,7 +33,7 @@
> DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
> static struct cpuinfo_arm64 boot_cpu_data;
>
> -static char *icache_policy_str[] = {
> +static const char *icache_policy_str[] = {
Can this be const char *const ?
The strings will be in .rodata and can't be modified anyway, but I
presume we don't modify the array elements either...
> [0 ... ICACHE_POLICY_PIPT] = "RESERVED/UNKNOWN",
> [ICACHE_POLICY_VIPT] = "VIPT",
> [ICACHE_POLICY_PIPT] = "PIPT",
[...]
Cheers
---Dave
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-14 9:07 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 [this message]
2019-08-13 14:16 ` [PATCH 2/3] arm64: constify aarch64_insn_encoding_class[] Mark Rutland
2019-08-14 9:10 ` Dave Martin
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=20190814090709.GK10425@arm.com \
--to=dave.martin@arm$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=will.deacon@arm$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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