s390: setup.c cleanup + build fix
PATCH 1/1 s390: setup.c cleanup + build fix
From: Heiko Carstens <[email protected]>
Cleanup & fix 31 bit compilation:
CC arch/s390/kernel/setup.oarch/s390/kernel/setup.c:83: error: initializer element is not computable at
load timearch/s390/kernel/setup.c:83: error: (near initialization for
'code_resource.start')
Not sure which patch in the -mm tree breaks this, but since this can be considered a cleanup it can be merged anyway.
---
Patch is against 2.6.17-mm1.
arch/s390/kernel/setup.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
arch/s390/kernel/setup.c +6 -9
@@ -47,6 +47,7 @@#include <asm/irq.h> #include <asm/page.h> #include <asm/ptrace.h> +#include <asm/sections.h> /* * Machine setup..
@@ -66,11 +67,6 @@ unsigned long __initdata zholes_size[MAXstatic unsigned long __initdata memory_end;/* -* Setup options -*/ -extern int _text,_etext, _edata, _end; - -/* * This is set up by the setup-routine at boot-time * for S390 need to find out, what we have to setup * using address 0x10400 ...
@@ -80,15 +76,11 @@ extern int _text,_etext, _edata, _end;static struct resource code_resource = { .name ="Kernel code" , - .start = (unsigned long ) &_text, - .end = (unsigned long ) &_etext -1 , .flags =IORESOURCE_BUSY |IORESOURCE_MEM , };static struct resource data_resource = { .name ="Kernel data" , - .start = (unsigned long ) &_etext, - .end = (unsigned long ) &_edata -1 , .flags =IORESOURCE_BUSY |IORESOURCE_MEM , };
@@ -422,6 +414,11 @@ setup_resources(void)struct resource *res;int i; + code_resource.start = (unsigned long ) &_text; + code_resource.end = (unsigned long ) &_etext -1 ; + data_resource.start = (unsigned long ) &_etext; + data_resource.end = (unsigned long ) &_edata -1 ; +for (i =0 ; i <MEMORY_CHUNKS && memory_chunk[i].size >0 ; i++) { res =alloc_bootmem_low (sizeof (struct resource )); res->flags =IORESOURCE_BUSY |IORESOURCE_MEM ;
Quoted 4 lines · On Fri, 23 Jun 2006 15:31:22 +0200 Heiko Carstens <[email protected]>…
From: Heiko Carstens <[email protected]>
Cleanup & fix 31 bit compilation:
Quoted 8 lines
CC
arch/s390/kernel/setup.oarch/s390/kernel/setup.c:83: error: initializer element is not computable at
load timearch/s390/kernel/setup.c:83: error: (near initialization for
'code_resource.start')
Not sure which patch in the -mm tree breaks this, but since this can be considered a cleanup it can be merged anyway.
That's strange.
Quoted 27 lines
/*
- * Setup options
- */arch/s390/kernel/setup.c +0
-7-extern int _text,_etext, _edata, _end; - -/* * This is set up by the setup-routine at boot-time * for S390 need to find out, what we have to setup * using address 0x10400 ... @@ -80,15 +76,11 @@ extern int _text,_etext, _edata, _end;static struct resource code_resource = { .name ="Kernel code" , - .start = (unsigned long ) &_text, - .end = (unsigned long ) &_etext -1 , .flags =IORESOURCE_BUSY |IORESOURCE_MEM , };static struct resource data_resource = { .name ="Kernel data" , - .start = (unsigned long ) &_etext, - .end = (unsigned long ) &_edata -1 , .flags =IORESOURCE_BUSY |IORESOURCE_MEM , };@@ -422,6 +414,11 @@ setup_resources(void)struct resource *res;
arch/s390/kernel/setup.c setup_resources(void) · line 424
Quoted 10 lines
arch/s390/kernel/setup.c +5
-0int i; + code_resource.start = (unsigned long ) &_text; + code_resource.end = (unsigned long ) &_etext -1 ; + data_resource.start = (unsigned long ) &_etext; + data_resource.end = (unsigned long ) &_edata -1 ; +for (i =0 ; i <MEMORY_CHUNKS && memory_chunk[i].size >0 ; i++) { res =alloc_bootmem_low (sizeof (struct resource )); res->flags =IORESOURCE_BUSY |IORESOURCE_MEM ;
The linker should be able to handle all that. I wonder why it didn't.
And it works for me. What is "31 bit compilation"?
Quoted 10 lines
Quoted 8 lines
CC
arch/s390/kernel/setup.oarch/s390/kernel/setup.c:83: error: initializer element is not computable at
load timearch/s390/kernel/setup.c:83: error: (near initialization for
'code_resource.start')
Not sure which patch in the -mm tree breaks this, but since this can be considered a cleanup it can be merged anyway.That's strange.
Indeed.
Quoted 3 lines
The linker should be able to handle all that. I wonder why it didn't.
And it works for me. What is "31 bit compilation"?
Switching off CONFIG_64BIT, so that you will get a 31 bit binary.