From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH trivial] arm64: constify hwcap_str
Date: Wed, 6 Nov 2013 17:32:47 +0100 [thread overview]
Message-ID: <1383755567-17244-1-git-send-email-ard.biesheuvel@linaro.org> (raw)
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.
arch/arm64/kernel/setup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 055cfb8..b6aa6b4 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -301,10 +301,10 @@ static int __init topology_init(void)
}
subsys_initcall(topology_init);
-static const char *hwcap_str[] = {
+static const char hwcap_str[][8] = {
"fp",
"asimd",
- NULL
+ ""
};
static int c_show(struct seq_file *m, void *v)
@@ -328,7 +328,7 @@ static int c_show(struct seq_file *m, void *v)
/* dump out the processor features */
seq_puts(m, "Features\t: ");
- for (i = 0; hwcap_str[i]; i++)
+ for (i = 0; hwcap_str[i][0]; i++)
if (elf_hwcap & (1 << i))
seq_printf(m, "%s ", hwcap_str[i]);
--
1.8.3.2
next reply other threads:[~2013-11-06 16:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 16:32 Ard Biesheuvel [this message]
2013-11-07 17:50 ` [PATCH trivial] arm64: constify hwcap_str Catalin Marinas
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=1383755567-17244-1-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--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).