mach-imx/mach-imx6ul.c: proper constness with __initconst
diff mbox

Message ID alpine.LFD.2.20.1511212024220.22569@knanqh.ubzr
State New
Headers show

Commit Message

Nicolas Pitre Nov. 22, 2015, 1:35 a.m. UTC
Both the pointer array and the pointed data have to be const when using
__initconst to be correct.  This also fixes LTO builds that otherwise 
fail with section mismatch errors.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

Comments

Shawn Guo Nov. 25, 2015, 3:07 a.m. UTC | #1
On Sat, Nov 21, 2015 at 08:35:31PM -0500, Nicolas Pitre wrote:
> Both the pointer array and the pointed data have to be const when using
> __initconst to be correct.  This also fixes LTO builds that otherwise 
> fail with section mismatch errors.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>

Applied, thanks.

Patch
diff mbox

diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c
index acaf7056ef..a38b16b699 100644
--- a/arch/arm/mach-imx/mach-imx6ul.c
+++ b/arch/arm/mach-imx/mach-imx6ul.c
@@ -84,7 +84,7 @@  static void __init imx6ul_init_late(void)
 		platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
 }
 
-static const char *imx6ul_dt_compat[] __initconst = {
+static const char * const imx6ul_dt_compat[] __initconst = {
 	"fsl,imx6ul",
 	NULL,
 };