mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 2/2] test-hexdump.c: Fix initconst confusion
Date: Wed, 8 Apr 2015 15:35:54 -0700	[thread overview]
Message-ID: <20150408153554.65c87de78f1c2289483f67e8@linux-foundation.org> (raw)
In-Reply-To: <1428498405-7019-2-git-send-email-andi@firstfloor.org>

On Wed,  8 Apr 2015 06:06:45 -0700 Andi Kleen <andi@firstfloor.org> wrote:

> From: Andi Kleen <ak@linux.intel.com>
> 
> const char *...[]  is not const, but an array of pointer to const.
> So these arrays cannot be __initconst, but must be __initdata
> 
> This fixes section conflicts with LTO.
> 
> --- a/lib/test-hexdump.c
> +++ b/lib/test-hexdump.c
> @@ -18,26 +18,26 @@ static const unsigned char data_b[] = {
>  
>  static const unsigned char data_a[] = ".2.{....p..$}.4...1.....L...C...";
>  
> -static const char *test_data_1_le[] __initconst = {
> +static const char * const test_data_1_le[] __initconst = {

const char * const __initconst

>  	"be", "32", "db", "7b", "0a", "18", "93", "b2",
>  	"70", "ba", "c4", "24", "7d", "83", "34", "9b",
>  	"a6", "9c", "31", "ad", "9c", "0f", "ac", "e9",
>  	"4c", "d1", "19", "99", "43", "b1", "af", "0c",
>  };
>  
> +static const char *test_data_2_le[] __initdata = {
> +static const char *test_data_4_le[] __initdata = {
> +static const char *test_data_8_le[] __initdata = {

const char * __initdata

Why is test_data_1_le[] different?

Can we make them all "const char * const __initconst"?  That would make
checkpatch happy ;)


  reply	other threads:[~2015-04-08 22:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 13:06 [PATCH 1/2] Don't let LATENCYTOP and LOCKDEP select KALLSYMS_ALL Andi Kleen
2015-04-08 13:06 ` [PATCH 2/2] test-hexdump.c: Fix initconst confusion Andi Kleen
2015-04-08 22:35   ` Andrew Morton [this message]
2015-04-08 23:52     ` Andi Kleen
2015-04-09  0:14       ` [PATCH] checkpatch: Add a test for const with __read_mostly uses Joe Perches
2015-04-09  0:28         ` Andi Kleen
2015-04-09  0:33           ` Joe Perches
2015-04-16 19:33       ` [PATCH 2/2] test-hexdump.c: Fix initconst confusion Geert Uytterhoeven
2015-04-16 21:21         ` Andi Kleen

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=20150408153554.65c87de78f1c2289483f67e8@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®