All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [MIPS] Move several variables from .bss to .init.data
@ 2009-11-23 11:53 Dmitri Vorobiev
  2009-11-23 11:58 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dmitri Vorobiev @ 2009-11-23 11:53 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Dmitri Vorobiev

Several static uninitialized variables are used in the scope of
__init functions but are themselves not marked as __initdata.
This patch is to put those variables to where they belong and
to reduce the memory footprint a little bit.

Also, a couple of lines with spaces instead of tabs were fixed.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
---
 arch/mips/ar7/platform.c        |    2 +-
 arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
 arch/mips/sgi-ip22/ip22-setup.c |    2 +-
 arch/mips/sgi-ip32/ip32-setup.c |    2 +-
 arch/mips/sni/setup.c           |    2 +-
 arch/mips/txx9/generic/setup.c  |    2 +-
 arch/mips/txx9/rbtx4939/setup.c |    4 ++--
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index 835f3f0..85169c0 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -505,7 +505,7 @@ static int __init ar7_register_devices(void)
 	int res;
 	u32 *bootcr, val;
 #ifdef CONFIG_SERIAL_8250
-	static struct uart_port uart_port[2];
+	static struct uart_port uart_port[2] __initdata;
 
 	memset(uart_port, 0, sizeof(struct uart_port) * 2);
 
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 1617241..da44ccb 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -50,9 +50,9 @@
 
 static char __init *decode_eisa_sig(unsigned long addr)
 {
-        static char sig_str[EISA_SIG_LEN];
+	static char sig_str[EISA_SIG_LEN] __initdata;
 	u8 sig[4];
-        u16 rev;
+	u16 rev;
 	int i;
 
 	for (i = 0; i < 4; i++) {
diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c
index b9a9313..5deeb68 100644
--- a/arch/mips/sgi-ip22/ip22-setup.c
+++ b/arch/mips/sgi-ip22/ip22-setup.c
@@ -67,7 +67,7 @@ void __init plat_mem_setup(void)
 	cserial = ArcGetEnvironmentVariable("ConsoleOut");
 
 	if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
-		static char options[8];
+		static char options[8] __initdata;
 		char *baud = ArcGetEnvironmentVariable("dbaud");
 		if (baud)
 			strcpy(options, baud);
diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c
index c5a5d4a..3abd146 100644
--- a/arch/mips/sgi-ip32/ip32-setup.c
+++ b/arch/mips/sgi-ip32/ip32-setup.c
@@ -90,7 +90,7 @@ void __init plat_mem_setup(void)
 	{
 		char* con = ArcGetEnvironmentVariable("console");
 		if (con && *con == 'd') {
-			static char options[8];
+			static char options[8] __initdata;
 			char *baud = ArcGetEnvironmentVariable("dbaud");
 			if (baud)
 				strcpy(options, baud);
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index a49272c..d16b462 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -60,7 +60,7 @@ static void __init sni_console_setup(void)
 	char *cdev;
 	char *baud;
 	int port;
-	static char options[8];
+	static char options[8] __initdata;
 
 	cdev = prom_getenv("console_dev");
 	if (strncmp(cdev, "tty", 3) == 0) {
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 06e801c..2cb8c49 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -664,7 +664,7 @@ void __init txx9_physmap_flash_init(int no, unsigned long addr,
 	};
 	struct platform_device *pdev;
 #ifdef CONFIG_MTD_PARTITIONS
-	static struct mtd_partition parts[2];
+	static struct mtd_partition parts[2] __initdata;
 	struct physmap_flash_data pdata_part;
 
 	/* If this area contained boot area, make separate partition */
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index b0c241e..64914d4 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -379,8 +379,8 @@ static void __init rbtx4939_mtd_init(void)
 		struct rbtx4939_flash_data data;
 	} pdevs[4];
 	int i;
-	static char names[4][8];
-	static struct mtd_partition parts[4];
+	static char names[4][8] __initdata;
+	static struct mtd_partition parts[4] __initdata;
 	struct rbtx4939_flash_data *boot_pdata = &pdevs[0].data;
 	u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f;
 
-- 
1.6.3.3

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 11:53 [PATCH] [MIPS] Move several variables from .bss to .init.data Dmitri Vorobiev
@ 2009-11-23 11:58 ` Florian Fainelli
  2009-11-23 12:14 ` Ralf Baechle
  2009-11-23 13:26 ` Atsushi Nemoto
  2 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2009-11-23 11:58 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: linux-mips, ralf

Hi Dmitri

On Monday 23 November 2009 12:53:37 Dmitri Vorobiev wrote:
> Several static uninitialized variables are used in the scope of
> __init functions but are themselves not marked as __initdata.
> This patch is to put those variables to where they belong and
> to reduce the memory footprint a little bit.
> 
> Also, a couple of lines with spaces instead of tabs were fixed.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>

For the ar7 bits:

Acked-by: Florian Fainelli <florian@openwrt.org>

> ---
>  arch/mips/ar7/platform.c        |    2 +-
>  arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
>  arch/mips/sgi-ip22/ip22-setup.c |    2 +-
>  arch/mips/sgi-ip32/ip32-setup.c |    2 +-
>  arch/mips/sni/setup.c           |    2 +-
>  arch/mips/txx9/generic/setup.c  |    2 +-
>  arch/mips/txx9/rbtx4939/setup.c |    4 ++--
>  7 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
> index 835f3f0..85169c0 100644
> --- a/arch/mips/ar7/platform.c
> +++ b/arch/mips/ar7/platform.c
> @@ -505,7 +505,7 @@ static int __init ar7_register_devices(void)
>  	int res;
>  	u32 *bootcr, val;
>  #ifdef CONFIG_SERIAL_8250
> -	static struct uart_port uart_port[2];
> +	static struct uart_port uart_port[2] __initdata;
> 
>  	memset(uart_port, 0, sizeof(struct uart_port) * 2);
> 
> diff --git a/arch/mips/sgi-ip22/ip22-eisa.c
>  b/arch/mips/sgi-ip22/ip22-eisa.c index 1617241..da44ccb 100644
> --- a/arch/mips/sgi-ip22/ip22-eisa.c
> +++ b/arch/mips/sgi-ip22/ip22-eisa.c
> @@ -50,9 +50,9 @@
> 
>  static char __init *decode_eisa_sig(unsigned long addr)
>  {
> -        static char sig_str[EISA_SIG_LEN];
> +	static char sig_str[EISA_SIG_LEN] __initdata;
>  	u8 sig[4];
> -        u16 rev;
> +	u16 rev;
>  	int i;
> 
>  	for (i = 0; i < 4; i++) {
> diff --git a/arch/mips/sgi-ip22/ip22-setup.c
>  b/arch/mips/sgi-ip22/ip22-setup.c index b9a9313..5deeb68 100644
> --- a/arch/mips/sgi-ip22/ip22-setup.c
> +++ b/arch/mips/sgi-ip22/ip22-setup.c
> @@ -67,7 +67,7 @@ void __init plat_mem_setup(void)
>  	cserial = ArcGetEnvironmentVariable("ConsoleOut");
> 
>  	if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
> -		static char options[8];
> +		static char options[8] __initdata;
>  		char *baud = ArcGetEnvironmentVariable("dbaud");
>  		if (baud)
>  			strcpy(options, baud);
> diff --git a/arch/mips/sgi-ip32/ip32-setup.c
>  b/arch/mips/sgi-ip32/ip32-setup.c index c5a5d4a..3abd146 100644
> --- a/arch/mips/sgi-ip32/ip32-setup.c
> +++ b/arch/mips/sgi-ip32/ip32-setup.c
> @@ -90,7 +90,7 @@ void __init plat_mem_setup(void)
>  	{
>  		char* con = ArcGetEnvironmentVariable("console");
>  		if (con && *con == 'd') {
> -			static char options[8];
> +			static char options[8] __initdata;
>  			char *baud = ArcGetEnvironmentVariable("dbaud");
>  			if (baud)
>  				strcpy(options, baud);
> diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
> index a49272c..d16b462 100644
> --- a/arch/mips/sni/setup.c
> +++ b/arch/mips/sni/setup.c
> @@ -60,7 +60,7 @@ static void __init sni_console_setup(void)
>  	char *cdev;
>  	char *baud;
>  	int port;
> -	static char options[8];
> +	static char options[8] __initdata;
> 
>  	cdev = prom_getenv("console_dev");
>  	if (strncmp(cdev, "tty", 3) == 0) {
> diff --git a/arch/mips/txx9/generic/setup.c
>  b/arch/mips/txx9/generic/setup.c index 06e801c..2cb8c49 100644
> --- a/arch/mips/txx9/generic/setup.c
> +++ b/arch/mips/txx9/generic/setup.c
> @@ -664,7 +664,7 @@ void __init txx9_physmap_flash_init(int no, unsigned
>  long addr, };
>  	struct platform_device *pdev;
>  #ifdef CONFIG_MTD_PARTITIONS
> -	static struct mtd_partition parts[2];
> +	static struct mtd_partition parts[2] __initdata;
>  	struct physmap_flash_data pdata_part;
> 
>  	/* If this area contained boot area, make separate partition */
> diff --git a/arch/mips/txx9/rbtx4939/setup.c
>  b/arch/mips/txx9/rbtx4939/setup.c index b0c241e..64914d4 100644
> --- a/arch/mips/txx9/rbtx4939/setup.c
> +++ b/arch/mips/txx9/rbtx4939/setup.c
> @@ -379,8 +379,8 @@ static void __init rbtx4939_mtd_init(void)
>  		struct rbtx4939_flash_data data;
>  	} pdevs[4];
>  	int i;
> -	static char names[4][8];
> -	static struct mtd_partition parts[4];
> +	static char names[4][8] __initdata;
> +	static struct mtd_partition parts[4] __initdata;
>  	struct rbtx4939_flash_data *boot_pdata = &pdevs[0].data;
>  	u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f;
> 

-- 
--
WBR, Florian

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 11:53 [PATCH] [MIPS] Move several variables from .bss to .init.data Dmitri Vorobiev
  2009-11-23 11:58 ` Florian Fainelli
@ 2009-11-23 12:14 ` Ralf Baechle
  2009-11-23 13:26 ` Atsushi Nemoto
  2 siblings, 0 replies; 11+ messages in thread
From: Ralf Baechle @ 2009-11-23 12:14 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: linux-mips

On Mon, Nov 23, 2009 at 01:53:37PM +0200, Dmitri Vorobiev wrote:

> Several static uninitialized variables are used in the scope of
> __init functions but are themselves not marked as __initdata.
> This patch is to put those variables to where they belong and
> to reduce the memory footprint a little bit.
> 
> Also, a couple of lines with spaces instead of tabs were fixed.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>

Thanks, queued for 2.6.33.

  Ralf

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 11:53 [PATCH] [MIPS] Move several variables from .bss to .init.data Dmitri Vorobiev
  2009-11-23 11:58 ` Florian Fainelli
  2009-11-23 12:14 ` Ralf Baechle
@ 2009-11-23 13:26 ` Atsushi Nemoto
  2009-11-23 13:43   ` Dmitri Vorobiev
  2009-11-23 13:46   ` Ralf Baechle
  2 siblings, 2 replies; 11+ messages in thread
From: Atsushi Nemoto @ 2009-11-23 13:26 UTC (permalink / raw)
  To: dmitri.vorobiev; +Cc: linux-mips, ralf

On Mon, 23 Nov 2009 13:53:37 +0200, Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:
> Several static uninitialized variables are used in the scope of
> __init functions but are themselves not marked as __initdata.
> This patch is to put those variables to where they belong and
> to reduce the memory footprint a little bit.
> 
> Also, a couple of lines with spaces instead of tabs were fixed.
> 
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
> ---
>  arch/mips/ar7/platform.c        |    2 +-
>  arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
>  arch/mips/sgi-ip22/ip22-setup.c |    2 +-
>  arch/mips/sgi-ip32/ip32-setup.c |    2 +-
>  arch/mips/sni/setup.c           |    2 +-
>  arch/mips/txx9/generic/setup.c  |    2 +-
>  arch/mips/txx9/rbtx4939/setup.c |    4 ++--
>  7 files changed, 9 insertions(+), 9 deletions(-)

NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
referenced by mtd map drivers via platform_data.

And for console option strings parts, I doubt these can be marked as
__initdata.  Theoretically, the console driver might be a module,

---
Atsushi Nemoto

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 13:26 ` Atsushi Nemoto
@ 2009-11-23 13:43   ` Dmitri Vorobiev
  2009-11-23 14:06     ` Atsushi Nemoto
  2009-11-23 13:46   ` Ralf Baechle
  1 sibling, 1 reply; 11+ messages in thread
From: Dmitri Vorobiev @ 2009-11-23 13:43 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: dmitri.vorobiev, linux-mips, ralf

On Mon, Nov 23, 2009 at 3:26 PM, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> On Mon, 23 Nov 2009 13:53:37 +0200, Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:
>> Several static uninitialized variables are used in the scope of
>> __init functions but are themselves not marked as __initdata.
>> This patch is to put those variables to where they belong and
>> to reduce the memory footprint a little bit.
>>
>> Also, a couple of lines with spaces instead of tabs were fixed.
>>
>> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
>> ---
>>  arch/mips/ar7/platform.c        |    2 +-
>>  arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
>>  arch/mips/sgi-ip22/ip22-setup.c |    2 +-
>>  arch/mips/sgi-ip32/ip32-setup.c |    2 +-
>>  arch/mips/sni/setup.c           |    2 +-
>>  arch/mips/txx9/generic/setup.c  |    2 +-
>>  arch/mips/txx9/rbtx4939/setup.c |    4 ++--
>>  7 files changed, 9 insertions(+), 9 deletions(-)
>
> NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
> referenced by mtd map drivers via platform_data.

You are right, thanks. What do you think about moving the variables to
file scope then?

Dmitri

>
> And for console option strings parts, I doubt these can be marked as
> __initdata.  Theoretically, the console driver might be a module,
>
> ---
> Atsushi Nemoto
>
>

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 13:26 ` Atsushi Nemoto
  2009-11-23 13:43   ` Dmitri Vorobiev
@ 2009-11-23 13:46   ` Ralf Baechle
  2009-11-23 13:59     ` Atsushi Nemoto
  1 sibling, 1 reply; 11+ messages in thread
From: Ralf Baechle @ 2009-11-23 13:46 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: dmitri.vorobiev, linux-mips

On Mon, Nov 23, 2009 at 10:26:09PM +0900, Atsushi Nemoto wrote:

> On Mon, 23 Nov 2009 13:53:37 +0200, Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:
> > Several static uninitialized variables are used in the scope of
> > __init functions but are themselves not marked as __initdata.
> > This patch is to put those variables to where they belong and
> > to reduce the memory footprint a little bit.
> > 
> > Also, a couple of lines with spaces instead of tabs were fixed.
> > 
> > Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
> > ---
> >  arch/mips/ar7/platform.c        |    2 +-
> >  arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
> >  arch/mips/sgi-ip22/ip22-setup.c |    2 +-
> >  arch/mips/sgi-ip32/ip32-setup.c |    2 +-
> >  arch/mips/sni/setup.c           |    2 +-
> >  arch/mips/txx9/generic/setup.c  |    2 +-
> >  arch/mips/txx9/rbtx4939/setup.c |    4 ++--
> >  7 files changed, 9 insertions(+), 9 deletions(-)
> 
> NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
> referenced by mtd map drivers via platform_data.

I'll drop the txx9 parts then.

> And for console option strings parts, I doubt these can be marked as
> __initdata.  Theoretically, the console driver might be a module,

No; if the driver is a module we don't offer console functionality.  Typical
example:

config SERIAL_8250
        tristate "8250/16550 and compatible serial support"
        select SERIAL_CORE
[...]
config SERIAL_8250_CONSOLE
        bool "Console on 8250/16550 and compatible serial port"
        depends on SERIAL_8250=y
        select SERIAL_CORE_CONSOLE

I think we consistently do this for all console drivers.

  Ralf

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 13:46   ` Ralf Baechle
@ 2009-11-23 13:59     ` Atsushi Nemoto
  2009-11-23 14:04       ` Ralf Baechle
  0 siblings, 1 reply; 11+ messages in thread
From: Atsushi Nemoto @ 2009-11-23 13:59 UTC (permalink / raw)
  To: ralf; +Cc: dmitri.vorobiev, linux-mips

On Mon, 23 Nov 2009 13:46:33 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> > And for console option strings parts, I doubt these can be marked as
> > __initdata.  Theoretically, the console driver might be a module,
> 
> No; if the driver is a module we don't offer console functionality.  Typical
> example:

Oh, I missed that.  Thanks.  Then no objections for this part.

---
Atsushi Nemoto

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 13:59     ` Atsushi Nemoto
@ 2009-11-23 14:04       ` Ralf Baechle
  0 siblings, 0 replies; 11+ messages in thread
From: Ralf Baechle @ 2009-11-23 14:04 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: dmitri.vorobiev, linux-mips

On Mon, Nov 23, 2009 at 10:59:19PM +0900, Atsushi Nemoto wrote:

> On Mon, 23 Nov 2009 13:46:33 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> > > And for console option strings parts, I doubt these can be marked as
> > > __initdata.  Theoretically, the console driver might be a module,
> > 
> > No; if the driver is a module we don't offer console functionality.  Typical
> > example:
> 
> Oh, I missed that.  Thanks.  Then no objections for this part.

So below is what I've got queued now.

Thanks everbody,

  Ralf

Date:	Mon, 23 Nov 2009 13:53:37 +0200
From:	Dmitri Vorobiev <dmitri.vorobiev@movial.com>

MIPS: Move several variables from .bss to .init.data

Several static uninitialized variables are used in the scope of __init
functions but are themselves not marked as __initdata.  This patch is to put
those variables to where they belong and to reduce the memory footprint a
little bit.

Also, a couple of lines with spaces instead of tabs were fixed.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/697/
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 arch/mips/ar7/platform.c        |    2 +-
 arch/mips/sgi-ip22/ip22-eisa.c  |    4 ++--
 arch/mips/sgi-ip22/ip22-setup.c |    2 +-
 arch/mips/sgi-ip32/ip32-setup.c |    2 +-
 arch/mips/sni/setup.c           |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-queue/arch/mips/ar7/platform.c
===================================================================
--- linux-queue.orig/arch/mips/ar7/platform.c
+++ linux-queue/arch/mips/ar7/platform.c
@@ -505,7 +505,7 @@ static int __init ar7_register_devices(v
 	int res;
 	u32 *bootcr, val;
 #ifdef CONFIG_SERIAL_8250
-	static struct uart_port uart_port[2];
+	static struct uart_port uart_port[2] __initdata;
 
 	memset(uart_port, 0, sizeof(struct uart_port) * 2);
 
Index: linux-queue/arch/mips/sgi-ip22/ip22-eisa.c
===================================================================
--- linux-queue.orig/arch/mips/sgi-ip22/ip22-eisa.c
+++ linux-queue/arch/mips/sgi-ip22/ip22-eisa.c
@@ -50,9 +50,9 @@
 
 static char __init *decode_eisa_sig(unsigned long addr)
 {
-        static char sig_str[EISA_SIG_LEN];
+	static char sig_str[EISA_SIG_LEN] __initdata;
 	u8 sig[4];
-        u16 rev;
+	u16 rev;
 	int i;
 
 	for (i = 0; i < 4; i++) {
Index: linux-queue/arch/mips/sgi-ip22/ip22-setup.c
===================================================================
--- linux-queue.orig/arch/mips/sgi-ip22/ip22-setup.c
+++ linux-queue/arch/mips/sgi-ip22/ip22-setup.c
@@ -67,7 +67,7 @@ void __init plat_mem_setup(void)
 	cserial = ArcGetEnvironmentVariable("ConsoleOut");
 
 	if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
-		static char options[8];
+		static char options[8] __initdata;
 		char *baud = ArcGetEnvironmentVariable("dbaud");
 		if (baud)
 			strcpy(options, baud);
Index: linux-queue/arch/mips/sgi-ip32/ip32-setup.c
===================================================================
--- linux-queue.orig/arch/mips/sgi-ip32/ip32-setup.c
+++ linux-queue/arch/mips/sgi-ip32/ip32-setup.c
@@ -90,7 +90,7 @@ void __init plat_mem_setup(void)
 	{
 		char* con = ArcGetEnvironmentVariable("console");
 		if (con && *con == 'd') {
-			static char options[8];
+			static char options[8] __initdata;
 			char *baud = ArcGetEnvironmentVariable("dbaud");
 			if (baud)
 				strcpy(options, baud);
Index: linux-queue/arch/mips/sni/setup.c
===================================================================
--- linux-queue.orig/arch/mips/sni/setup.c
+++ linux-queue/arch/mips/sni/setup.c
@@ -60,7 +60,7 @@ static void __init sni_console_setup(voi
 	char *cdev;
 	char *baud;
 	int port;
-	static char options[8];
+	static char options[8] __initdata;
 
 	cdev = prom_getenv("console_dev");
 	if (strncmp(cdev, "tty", 3) == 0) {

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 13:43   ` Dmitri Vorobiev
@ 2009-11-23 14:06     ` Atsushi Nemoto
  2009-11-23 14:37       ` Dmitri Vorobiev
  0 siblings, 1 reply; 11+ messages in thread
From: Atsushi Nemoto @ 2009-11-23 14:06 UTC (permalink / raw)
  To: dmitri.vorobiev; +Cc: dmitri.vorobiev, linux-mips, ralf

On Mon, 23 Nov 2009 15:43:27 +0200, Dmitri Vorobiev <dmitri.vorobiev@gmail.com> wrote:
> On Mon, Nov 23, 2009 at 3:26 PM, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> > On Mon, 23 Nov 2009 13:53:37 +0200, Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:
> >> Several static uninitialized variables are used in the scope of
> >> __init functions but are themselves not marked as __initdata.
> >> This patch is to put those variables to where they belong and
> >> to reduce the memory footprint a little bit.
> >>
> >> Also, a couple of lines with spaces instead of tabs were fixed.
> >>
> >> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
> >
> > NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
> > referenced by mtd map drivers via platform_data.
> 
> You are right, thanks. What do you think about moving the variables to
> file scope then?

Well, why?  Does it make any check-scripts or something happy?

---
Atsushi Nemoto

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 14:06     ` Atsushi Nemoto
@ 2009-11-23 14:37       ` Dmitri Vorobiev
  2009-11-23 15:19         ` Atsushi Nemoto
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitri Vorobiev @ 2009-11-23 14:37 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: dmitri.vorobiev, linux-mips, ralf

On Mon, Nov 23, 2009 at 4:06 PM, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> On Mon, 23 Nov 2009 15:43:27 +0200, Dmitri Vorobiev <dmitri.vorobiev@gmail.com> wrote:
>> On Mon, Nov 23, 2009 at 3:26 PM, Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
>> > On Mon, 23 Nov 2009 13:53:37 +0200, Dmitri Vorobiev <dmitri.vorobiev@movial.com> wrote:
>> >> Several static uninitialized variables are used in the scope of
>> >> __init functions but are themselves not marked as __initdata.
>> >> This patch is to put those variables to where they belong and
>> >> to reduce the memory footprint a little bit.
>> >>
>> >> Also, a couple of lines with spaces instead of tabs were fixed.
>> >>
>> >> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
>> >
>> > NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
>> > referenced by mtd map drivers via platform_data.
>>
>> You are right, thanks. What do you think about moving the variables to
>> file scope then?
>
> Well, why?  Does it make any check-scripts or something happy?

That's just looked somehow confusing to me that a variable defined in
the function scope was referenced from far outside this function, and
even when the function itself isn't valid anymore. Of course, there
are no technical disadvantage in that in itself.

Dmitri

>
> ---
> Atsushi Nemoto
>

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

* Re: [PATCH] [MIPS] Move several variables from .bss to .init.data
  2009-11-23 14:37       ` Dmitri Vorobiev
@ 2009-11-23 15:19         ` Atsushi Nemoto
  0 siblings, 0 replies; 11+ messages in thread
From: Atsushi Nemoto @ 2009-11-23 15:19 UTC (permalink / raw)
  To: dmitri.vorobiev; +Cc: dmitri.vorobiev, linux-mips, ralf

On Mon, 23 Nov 2009 16:37:27 +0200, Dmitri Vorobiev <dmitri.vorobiev@gmail.com> wrote:
> >> > NAK, at least for txx9 parts.  The struct mtd_partition arrays will be
> >> > referenced by mtd map drivers via platform_data.
> >>
> >> You are right, thanks. What do you think about moving the variables to
> >> file scope then?
> >
> > Well, why?  Does it make any check-scripts or something happy?
> 
> That's just looked somehow confusing to me that a variable defined in
> the function scope was referenced from far outside this function, and
> even when the function itself isn't valid anymore. Of course, there
> are no technical disadvantage in that in itself.

I see.  But that's not so irregular case I think.  And even if the
variables are outside the function, it will not be obvious that it
cannot be marked as __initdata.

I agree that the code looks ugly and confusing, but moving it outside
does not helps, I think.

---
Atsushi Nemoto

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

end of thread, other threads:[~2009-11-23 15:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-23 11:53 [PATCH] [MIPS] Move several variables from .bss to .init.data Dmitri Vorobiev
2009-11-23 11:58 ` Florian Fainelli
2009-11-23 12:14 ` Ralf Baechle
2009-11-23 13:26 ` Atsushi Nemoto
2009-11-23 13:43   ` Dmitri Vorobiev
2009-11-23 14:06     ` Atsushi Nemoto
2009-11-23 14:37       ` Dmitri Vorobiev
2009-11-23 15:19         ` Atsushi Nemoto
2009-11-23 13:46   ` Ralf Baechle
2009-11-23 13:59     ` Atsushi Nemoto
2009-11-23 14:04       ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.