Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Sat, 7 Nov 2009
 10:21:11 -0700
Received: from mail1.lsil.com (mail1.lsil.com [147.145.40.21])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id nA7HLBeL006766	for
 <andy.sharp@lsi.com>; Sat, 7 Nov 2009 09:21:11 -0800
Received: from psmtp.com (na3sys009amx205.postini.com [74.125.149.45])	by
 mail1.lsil.com (8.12.11/8.12.11) with SMTP id nA7HL94J010760	for
 <andy.sharp@lsi.com>; Sat, 7 Nov 2009 09:21:09 -0800 (PST)
Received: from source ([78.24.191.182]) by na3sys009amx205.postini.com
 ([74.125.148.14]) with SMTP;	Sat, 07 Nov 2009 17:21:10 GMT
Received: from localhost.localdomain ([127.0.0.1]:52225 "EHLO
	eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by ftp.linux-mips.org	with
 ESMTP id S1492872AbZKGRVH (ORCPT <rfc822;andy.sharp@lsi.com>);	Sat, 7 Nov
 2009 18:21:07 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 07 Nov 2009 18:20:49
 +0100 (CET)
Received: from mba.ocn.ne.jp ([122.28.14.163]:56616 "HELO smtp.mba.ocn.ne.jp"
	rhost-flags-OK-OK-OK-OK) by ftp.linux-mips.org with SMTP	id S1492878AbZKGRUm
 (ORCPT <rfc822;linux-mips@linux-mips.org>);	Sat, 7 Nov 2009 18:20:42 +0100
Received: from localhost.localdomain (p6079-ipad307funabasi.chiba.ocn.ne.jp
 [123.217.184.79])	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP	id 94FFE71C9;
 Sun,  8 Nov 2009 02:20:38 +0900 (JST)
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
CC: "ralf@linux-mips.org" <ralf@linux-mips.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Sat, 7 Nov 2009 10:20:37 -0700
Subject: [PATCH] MIPS: Make local arrays with CL_SIZE static __initdata
Thread-Topic: [PATCH] MIPS: Make local arrays with CL_SIZE static __initdata
Thread-Index: AcpfzrPOfi4YXdFXSD+MONKXyphAxw==
Message-ID: <1257614437-8632-1-git-send-email-anemo@mba.ocn.ne.jp>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-pstn-levels: (S:38.37770/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <anemo@mba.ocn.ne.jp> [22/1] 
x-pstn-neptune: 0/0/0.00/0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Since commit 22242681 ("MIPS: Extend COMMAND_LINE_SIZE"), CL_SIZE is
4096 and local array variables with this size will cause an build
failure with default CONFIG_FRAME_WARN settings.

Although current users of such array variables are all early bootstrap
code and might not cause real stack overflow (thread_info corruption),
it would be safe to declare these arrays static with __initdata.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 arch/mips/bcm47xx/prom.c           |    2 +-
 arch/mips/mti-malta/malta-memory.c |    3 ++-
 arch/mips/rb532/prom.c             |    2 +-
 arch/mips/txx9/generic/setup.c     |    4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
index 079e33d..fb284c3 100644
--- a/arch/mips/bcm47xx/prom.c
+++ b/arch/mips/bcm47xx/prom.c
@@ -100,7 +100,7 @@ static __init void prom_init_console(void)
=20
 static __init void prom_init_cmdline(void)
 {
-	char buf[CL_SIZE];
+	static char buf[CL_SIZE] __initdata;
=20
 	/* Get the kernel command line from CFE */
 	if (cfe_getenv("LINUX_CMDLINE", buf, CL_SIZE) >=3D 0) {
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta=
-memory.c
index 61888ff..9035c64 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -54,7 +54,8 @@ static struct prom_pmemblock * __init prom_getmdesc(void)
 {
 	char *memsize_str;
 	unsigned int memsize;
-	char cmdline[CL_SIZE], *ptr;
+	char *ptr;
+	static char cmdline[CL_SIZE] __initdata;
=20
 	/* otherwise look in the environment */
 	memsize_str =3D prom_getenv("memsize");
diff --git a/arch/mips/rb532/prom.c b/arch/mips/rb532/prom.c
index 46ca24d..ad5bd10 100644
--- a/arch/mips/rb532/prom.c
+++ b/arch/mips/rb532/prom.c
@@ -69,7 +69,7 @@ static inline unsigned long tag2ul(char *arg, const char =
*tag)
=20
 void __init prom_setup_cmdline(void)
 {
-	char cmd_line[CL_SIZE];
+	static char cmd_line[CL_SIZE] __initdata;
 	char *cp, *board;
 	int prom_argc;
 	char **prom_argv, **prom_envp;
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.=
c
index e10184c..d66802e 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -160,7 +160,7 @@ static void __init prom_init_cmdline(void)
 	int argc;
 	int *argv32;
 	int i;			/* Always ignore the "-c" at argv[0] */
-	char builtin[CL_SIZE];
+	static char builtin[CL_SIZE] __initdata;
=20
 	if (fw_arg0 >=3D CKSEG0 || fw_arg1 < CKSEG0) {
 		/*
@@ -315,7 +315,7 @@ static inline void txx9_cache_fixup(void)
=20
 static void __init preprocess_cmdline(void)
 {
-	char cmdline[CL_SIZE];
+	static char cmdline[CL_SIZE] __initdata;
 	char *s;
=20
 	strcpy(cmdline, arcs_cmdline);
--=20
1.5.6.5


