linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH trivial] arm64: constify hwcap_str
Date: Thu, 7 Nov 2013 17:50:11 +0000	[thread overview]
Message-ID: <20131107175010.GI13674@arm.com> (raw)
In-Reply-To: <1383755567-17244-1-git-send-email-ard.biesheuvel@linaro.org>

On Wed, Nov 06, 2013 at 04:32:47PM +0000, Ard Biesheuvel wrote:
> Turn hwcap_str from a 'writable array of pointers to const char[]'
> to a multidimensional const char[][].
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> 
> This is something I noticed when looking at Steve Capper's hwcaps patch: really
> no point in having a writable array of 8-byte pointers in .data keeping track of
> these hwcap strings.

I don't see a problem (few bytes wasted). If you want to make it
read-only, this would do:

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 9cf30f49610d..84a770fd7003 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -308,7 +308,7 @@ static int __init topology_init(void)
 }
 subsys_initcall(topology_init);
 
-static const char *hwcap_str[] = {
+static const char *const hwcap_str[] = {
 	"fp",
 	"asimd",
 	NULL

-- 
Catalin

  reply	other threads:[~2013-11-07 17:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 16:32 [PATCH trivial] arm64: constify hwcap_str Ard Biesheuvel
2013-11-07 17:50 ` Catalin Marinas [this message]
2013-11-07 18:53   ` Ard Biesheuvel
2013-11-08 14:38     ` Catalin Marinas
2013-11-08 17:14       ` Ard Biesheuvel
2013-11-08 17:19         ` Catalin Marinas
2013-11-08 17:27           ` Ard Biesheuvel

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=20131107175010.GI13674@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).