linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mach-shmobile/setup-r8a7793.c: proper constness with __initconst
@ 2015-11-22  1:41 Nicolas Pitre
  2015-11-23  1:11 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pitre @ 2015-11-22  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

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>

diff --git a/arch/arm/mach-shmobile/setup-r8a7793.c b/arch/arm/mach-shmobile/setup-r8a7793.c
index 1d2825cb7a..5fce87f7f2 100644
--- a/arch/arm/mach-shmobile/setup-r8a7793.c
+++ b/arch/arm/mach-shmobile/setup-r8a7793.c
@@ -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,
 };

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] mach-shmobile/setup-r8a7793.c: proper constness with __initconst
  2015-11-22  1:41 [PATCH] mach-shmobile/setup-r8a7793.c: proper constness with __initconst Nicolas Pitre
@ 2015-11-23  1:11 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2015-11-23  1:11 UTC (permalink / raw)
  To: linux-arm-kernel

[CC: linux-sh]

On Sat, Nov 21, 2015 at 08:41:07PM -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>

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

Fixes: ec60d95b4fac ("ARM: shmobile: Basic r8a7793 SoC support")

> diff --git a/arch/arm/mach-shmobile/setup-r8a7793.c b/arch/arm/mach-shmobile/setup-r8a7793.c
> index 1d2825cb7a..5fce87f7f2 100644
> --- a/arch/arm/mach-shmobile/setup-r8a7793.c
> +++ b/arch/arm/mach-shmobile/setup-r8a7793.c
> @@ -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,
>  };
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-23  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-22  1:41 [PATCH] mach-shmobile/setup-r8a7793.c: proper constness with __initconst Nicolas Pitre
2015-11-23  1:11 ` Simon Horman

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).