linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: AR7: constify some arrays in gpio and prom code

To: Florian Fainelli <florian@openwrt.org>
Subject: Re: [PATCH] MIPS: AR7: constify some arrays in gpio and prom code
From: Ralf Baechle <ralf@linux-mips.org>
Date: Fri, 4 Nov 2011 17:41:40 +0000
Cc: linux-mips@linux-mips.org
In-reply-to: <1320427535-24351-1-git-send-email-florian@openwrt.org>
References: <1320427535-24351-1-git-send-email-florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Nov 04, 2011 at 06:25:35PM +0100, Florian Fainelli wrote:

> diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
> index 8088c6f..f642f64 100644
> --- a/arch/mips/ar7/prom.c
> +++ b/arch/mips/ar7/prom.c
> @@ -69,7 +69,7 @@ struct psbl_rec {
>       u32     ffs_size;
>  };
>  
> -static __initdata char psp_env_version[] = "TIENV0.8";
> +static __initdata const char psp_env_version[] = "TIENV0.8";

Should be:

static const char psp_env_version[] __initconst = "TIENV0.8";

so psp_env_version actually ends up in a read-only section.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>