Re: [PATCH 03/17] ARM: mark const init data with __initconst instead of __initdata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hello Shawn,

On Fri, Mar 30, 2012 at 02:11:36PM +0800, Shawn Guo wrote:
> On Thu, Mar 29, 2012 at 11:12:20PM +0200, Uwe Kleine-König wrote:
> ...
> > diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
> > index 5cca573..7e00748 100644
> > --- a/arch/arm/mach-imx/imx51-dt.c
> > +++ b/arch/arm/mach-imx/imx51-dt.c
> > @@ -102,7 +102,7 @@ static struct sys_timer imx51_timer = {
> >  	.init = imx51_timer_init,
> >  };
> >  
> > -static const char *imx51_dt_board_compat[] __initdata = {
> > +static const char *imx51_dt_board_compat[] __initconst = {
> >  	"fsl,imx51-babbage",
> >  	"fsl,imx51",
> >  	NULL
> 
>   CC      arch/arm/mach-imx/imx51-dt.o
> arch/arm/mach-imx/imx51-dt.c:105:20: error: imx51_dt_board_compat causes a section type conflict
> make[2]: *** [arch/arm/mach-imx/imx51-dt.o] Error 1
> 
> I do not understand why though.
that's because the strings are constant, but the array is not. The fix
is:

-static const char *imx51_dt_board_compat[] __initconst = {
+static const char *const imx51_dt_board_compat[] __initconst = {

or keeping __initdata.

Best regards
Uwe

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter