linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: orion: mark orion_ge00_mvmdio_bus_name as const
Date: Wed, 21 Feb 2018 04:49:38 +0100	[thread overview]
Message-ID: <20180221034938.GE14844@lunn.ch> (raw)
In-Reply-To: <20180220162519.1498223-2-arnd@arndb.de>

On Tue, Feb 20, 2018 at 05:24:51PM +0100, Arnd Bergmann wrote:
> A section type mismatch warning shows up when building with LTO,
> since orion_ge00_mvmdio_bus_name was put in __initconst but not marked
> const itself:
> 
> include/linux/of.h: In function 'spear_setup_of_timer':
> arch/arm/mach-spear/time.c:207:34: error: 'timer_of_match' causes a section type conflict with 'orion_ge00_mvmdio_bus_name'
>  static const struct of_device_id timer_of_match[] __initconst = {
>                                   ^
> arch/arm/plat-orion/common.c:475:32: note: 'orion_ge00_mvmdio_bus_name' was declared here
>  static __initconst const char *orion_ge00_mvmdio_bus_name = "orion-mii";
>
> This marks it const as well.

Hi Arnd

I'm not sure this is the correct fix. orion_ge00_mvmdio_bus_name is
assigned to orion_ge00_switch_board_info->bus_id. This is then passed
to mdiobus_register_board_info() which makes a copy of
orion_ge00_switch_board_info and adds it to its linked list. The
original orion_ge00_switch_board_info will get freed since it is
__initdata, but the copy still has a pointer to
orion_ge00_mvmdio_bus_name, which also gets freed.

I think the correct fix is to remove the __initconst from
orion_ge00_mvmdio_bus_name. Marking it const is however valid.

	Andrew

  reply	other threads:[~2018-02-21  3:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 16:24 [PATCH 1/3] ARM: clps711x: mark clps711x_compat as const Arnd Bergmann
2018-02-20 16:24 ` [PATCH 2/3] ARM: orion: mark orion_ge00_mvmdio_bus_name " Arnd Bergmann
2018-02-21  3:49   ` Andrew Lunn [this message]
2018-02-21 11:34     ` Arnd Bergmann
2018-02-20 16:24 ` [PATCH 3/3] ARM: davinci: mark spi_board_info arrays " Arnd Bergmann
2018-02-22 16:43   ` Arnd Bergmann
2018-02-23 10:00     ` Sekhar Nori
2018-02-22 16:43 ` [PATCH 1/3] ARM: clps711x: mark clps711x_compat " Arnd Bergmann

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=20180221034938.GE14844@lunn.ch \
    --to=andrew@lunn.ch \
    --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).