Skip to contentSkip to conversation

h8300 setup.c initrd support fix

PATCH In review Yoshinori Sato 2 participants 7 messages Feb 16, 2008 – Feb 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 h8300 setup.c initrd support fix

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +3 -2
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif
Signature · 5 lines
1.5.4.1

-- 
Yoshinori Sato
<[email protected]>
#1 lore raw

At Sat, 16 Feb 2008 01:13:37 -0500,

Quoted 35 lines · Yoshinori Sato

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +3 -2
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif
Signature · 5 lines
1.5.4.1

-- 
Yoshinori Sato
<[email protected]>
#2 lore raw
In reply to Yoshinori Sato
Quoted 18 lines · On Sat, 16 Feb 2008 01:13:37 -0500 Yoshinori Sato <[email protected]>…

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

arch/h8300/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 107

Quoted 10 lines
arch/h8300/kernel/setup.c +2 -2
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

But include/linux/initrd.h declares:

	extern unsigned long initrd_start, initrd_end;
#3 lore raw

At Fri, 15 Feb 2008 22:29:49 -0800,

Quoted 34 lines · Andrew Morton
Quoted 18 lines · On Sat, 16 Feb 2008 01:13:37 -0500 Yoshinori Sato <[email protected]>…

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

arch/h8300/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 107

Quoted 10 lines
arch/h8300/kernel/setup.c +2 -2
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

But include/linux/initrd.h declares:

Quoted 2 lines
	extern unsigned long initrd_start, initrd_end;

fix it.

 arch/h8300/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/h8300/kernel/setup.c +1 -1
index 75712ec..4dd744f 100644
@@ -30,6 +30,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -57,7 +58,6 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
-extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)
Signature · 5 lines
1.5.4.1

-- 
Yoshinori Sato
<[email protected]>
#4 lore raw
Quoted 36 lines · On Sat, 16 Feb 2008 23:39:09 -0500 Yoshinori Sato <[email protected]>…

At Fri, 15 Feb 2008 22:29:49 -0800,

Quoted 34 lines · Andrew Morton
Quoted 18 lines · On Sat, 16 Feb 2008 01:13:37 -0500 Yoshinori Sato <[email protected]>…

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

arch/h8300/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 107

Quoted 10 lines
arch/h8300/kernel/setup.c +2 -2
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

But include/linux/initrd.h declares:

Quoted 4 lines
Quoted 2 lines
	extern unsigned long initrd_start, initrd_end;

fix it.

I assume this new patch is an addition to the previous one quoted above?

Quoted 18 lines
 arch/h8300/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index 75712ec..4dd744f 100644
@@ -30,6 +30,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>

arch/h8300/kernel/setup.c extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; · line 63

Quoted 7 lines
arch/h8300/kernel/setup.c +0 -1
@@ -57,7 +58,6 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
-extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

If so then surely it generated a warning when assigning a void* to an unsigned long.

So please send a complete new fully tested patch. Please also include a changelog which describes what is being fixed, and how it is fixed. The text "initrd setting fix." and "fit it" is not sufficient - it doesn't tell us what was wrong with the old code, nor how the change improved it.

Thanks.

#5 lore raw

At Sat, 16 Feb 2008 20:55:02 -0800,

Quoted 75 lines · Andrew Morton
Quoted 36 lines · On Sat, 16 Feb 2008 23:39:09 -0500 Yoshinori Sato <[email protected]>…

At Fri, 15 Feb 2008 22:29:49 -0800,

Quoted 34 lines · Andrew Morton
Quoted 18 lines · On Sat, 16 Feb 2008 01:13:37 -0500 Yoshinori Sato <[email protected]>…

initrd setting fix.

 arch/h8300/kernel/setup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index b1f25c2..75712ec 100644
@@ -57,6 +57,7 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
+extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

arch/h8300/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 107

Quoted 10 lines
arch/h8300/kernel/setup.c +2 -2
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

But include/linux/initrd.h declares:

Quoted 4 lines
Quoted 2 lines
	extern unsigned long initrd_start, initrd_end;

fix it.

I assume this new patch is an addition to the previous one quoted above?

Quoted 18 lines
 arch/h8300/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/h8300/kernel/setup.c +1 -0
index 75712ec..4dd744f 100644
@@ -30,6 +30,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>

arch/h8300/kernel/setup.c extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; · line 63

Quoted 7 lines
arch/h8300/kernel/setup.c +0 -1
@@ -57,7 +58,6 @@ extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
 extern char _target_name[];
 extern void h8300_gpio_init(void);
-extern void *initrd_start, *initrd_end;
 
 #if (defined(CONFIG_H8300H_SIM) || defined(CONFIG_H8S_SIM)) \
     && defined(CONFIG_GDB_MAGICPRINT)

If so then surely it generated a warning when assigning a void* to an unsigned long.

Quoted 6 lines

So please send a complete new fully tested patch. Please also include a changelog which describes what is being fixed, and how it is fixed. The text "initrd setting fix." and "fit it" is not sufficient - it doesn't tell us what was wrong with the old code, nor how the change improved it.

Thanks.

Sorry. I mistake orign.

 arch/h8300/kernel/setup.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/h8300/kernel/setup.c +3 -2
index b1f25c2..4dd744f 100644
@@ -30,6 +30,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

--
1.5.4.1

Signature · 2 lines
Yoshinori Sato
<[email protected]>
#6 lore raw
Quoted 4 lines · On Sun, 17 Feb 2008 00:09:47 -0500 Yoshinori Sato <[email protected]>…

Sorry. I mistake orign.

Please include a full description of your patches!

Quoted 14 lines
arch/h8300/kernel/setup.c +1 -0
index b1f25c2..4dd744f 100644
@@ -30,6 +30,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/initrd.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>

arch/h8300/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 107

Quoted 10 lines
arch/h8300/kernel/setup.c +2 -2
@@ -99,8 +100,8 @@ void __init setup_arch(char **cmdline_p)
 	/* allow for ROMFS on the end of the kernel */
 	if (memcmp((void *)memory_start, "-rom1fs-", 8) == 0) {
 #if defined(CONFIG_BLK_DEV_INITRD)
-		initrd_start = memory_start;
-		initrd_end = memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]);
+		initrd_start = (void *)memory_start;
+		initrd_end = (void *)(memory_start += be32_to_cpu(((unsigned long *) (memory_start))[2]));
 #else
 		memory_start += be32_to_cpu(((unsigned long *) memory_start)[2]);
 #endif

This is still wrong.

initrd_start and initrd_end have type `unsigned long'. But the right-hand-side of these assignemtns has type void*. THe compiler will warn.