linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: appropriate __init annotation for const data
Date: Mon, 27 Jul 2015 07:59:13 +0200	[thread overview]
Message-ID: <20150727055913.GR745@pengutronix.de> (raw)
In-Reply-To: <alpine.LFD.2.20.1507241440550.1806@knanqh.ubzr>

Hello Nico,

On Fri, Jul 24, 2015 at 02:54:04PM -0400, Nicolas Pitre wrote:
> 
> Init data marked const should be annotated with __initconst for
> correctness and not __initdata.  This also fixes LTO builds that
> otherwise fails with section mismatch errors.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> 
> diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
> index 4e9837ded9..87eb359048 100644
> --- a/arch/arm/mach-cns3xxx/core.c
> +++ b/arch/arm/mach-cns3xxx/core.c
> @@ -392,7 +392,7 @@ static void __init cns3xxx_init(void)
>                          cns3xxx_auxdata, NULL);
>  }
>  
> -static const char *cns3xxx_dt_compat[] __initdata = {
> +static const char *cns3xxx_dt_compat[] __initconst = {
this one (and a few others) are wrong. This is a (mutable) array of
pointers to constant strings and so you have to use one of:

	static const char *cns3xxx_dt_compat[] __initdata = {
	static const char *const cns3xxx_dt_compat[] __initconst = {

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

      parent reply	other threads:[~2015-07-27  5:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 18:54 [PATCH] ARM: appropriate __init annotation for const data Nicolas Pitre
2015-07-26 19:39 ` Olof Johansson
2015-07-27  4:00 ` Nicolas Pitre
2015-07-27  6:46   ` Olof Johansson
2015-07-27  5:59 ` Uwe Kleine-König [this message]

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=20150727055913.GR745@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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).