Skip to contentSkip to conversation

mach-shmobile/setup-r8a7793.c: proper constness with __initconst

PATCH New Nicolas Pitre 2 participants 2 messages Nov 22, 2015 – Nov 23, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mach-shmobile/setup-r8a7793.c: proper constness with __initconst

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.

arch/arm/mach-shmobile/setup-r8a7793.c +1 -1
index 1d2825cb7a..5fce87f7f2 100644
@@ -19,7 +19,7 @@
 #include "common.h"
 #include "rcar-gen2.h"
 
-static const char *r8a7793_boards_compat_dt[] __initconst = {
+static const char * const r8a7793_boards_compat_dt[] __initconst = {
 	"renesas,r8a7793",
 	NULL,
 };
#1 lore raw

PATCH 1/1 mach-shmobile/setup-r8a7793.c: proper constness with __initconst

[CC: linux-sh]

Quoted 5 lines · Nicolas Pitre

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.

Thanks, I have queued this up as a fix for v4.4 with the following tag:

Fixes ec60d95b4fac ("ARM: shmobile: Basic r8a7793 SoC support")
Quoted 14 lines
arch/arm/mach-shmobile/setup-r8a7793.c +1 -1
index 1d2825cb7a..5fce87f7f2 100644
@@ -19,7 +19,7 @@
 #include "common.h"
 #include "rcar-gen2.h"
 
-static const char *r8a7793_boards_compat_dt[] __initconst = {
+static const char * const r8a7793_boards_compat_dt[] __initconst = {
 	"renesas,r8a7793",
 	NULL,
 };