Skip to content

Commit 3b44976

Browse files
Greg UngererGreg Ungerer
authored andcommitted
m68k: coldfire: fix warnings in uboot argument processing
When building with W=1: CC arch/m68k/kernel/uboot.o arch/m68k/kernel/uboot.c: In function ‘parse_uboot_commandline’: arch/m68k/kernel/uboot.c:68:36: warning: variable ‘uboot_initrd_end’ set but not used [-Wunused-but-set-variable] unsigned long uboot_initrd_start, uboot_initrd_end; ^~~~~~~~~~~~~~~~ arch/m68k/kernel/uboot.c:68:16: warning: variable ‘uboot_initrd_start’ set but not used [-Wunused-but-set-variable] unsigned long uboot_initrd_start, uboot_initrd_end; ^~~~~~~~~~~~~~~~~~ arch/m68k/kernel/uboot.c:66:16: warning: variable ‘uboot_kbd’ set but not used [-Wunused-but-set-variable] unsigned long uboot_kbd; ^~~~~~~~~ arch/m68k/kernel/uboot.c: At top level: arch/m68k/kernel/uboot.c:90:13: warning: no previous prototype for ‘process_uboot_commandline’ [-Wmissing-prototypes] __init void process_uboot_commandline(char *commandp, int size) ^~~~~~~~~~~~~~~~~~~~~~~~~ A couple of issues here. Firstly we already have a bootinfo.h that has a prototype for process_uboot_commandline(), we should include that. Secondly uboot_kbd is not used at all and can be removed. Thirdly the conditional code based on CONFIG_BLK_DEV_INITRD means that sometimes uboot_initrd_start and uboot_initrd_end are not needed. Make their declaration and asignment conditional on CONFIG_BLK_DEV_INITRD same as the code that uses them. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
1 parent 7c2aa8d commit 3b44976

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arch/m68k/kernel/uboot.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <asm/irq.h>
2828
#include <asm/machdep.h>
2929
#include <asm/sections.h>
30+
#include <asm/bootinfo.h>
3031

3132
/*
3233
* parse_uboot_commandline
@@ -63,20 +64,22 @@ static void __init parse_uboot_commandline(char *commandp, int size)
6364
{
6465
extern unsigned long _init_sp;
6566
unsigned long *sp;
66-
unsigned long uboot_kbd;
67-
unsigned long uboot_initrd_start, uboot_initrd_end;
6867
unsigned long uboot_cmd_start, uboot_cmd_end;
68+
#if defined(CONFIG_BLK_DEV_INITRD)
69+
unsigned long uboot_initrd_start, uboot_initrd_end;
70+
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
6971

7072
sp = (unsigned long *)_init_sp;
71-
uboot_kbd = sp[1];
72-
uboot_initrd_start = sp[2];
73-
uboot_initrd_end = sp[3];
7473
uboot_cmd_start = sp[4];
7574
uboot_cmd_end = sp[5];
7675

7776
if (uboot_cmd_start && uboot_cmd_end)
7877
strncpy(commandp, (const char *)uboot_cmd_start, size);
78+
7979
#if defined(CONFIG_BLK_DEV_INITRD)
80+
uboot_initrd_start = sp[2];
81+
uboot_initrd_end = sp[3];
82+
8083
if (uboot_initrd_start && uboot_initrd_end &&
8184
(uboot_initrd_end > uboot_initrd_start)) {
8285
initrd_start = uboot_initrd_start;

0 commit comments

Comments
 (0)