Skip to contentSkip to conversation

fix lib_arm/bootm.c

PATCH New Daniel Mack 4 participants 5 messages Nov 28, 2008 – Nov 29, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix lib_arm/bootm.c

Hi,

while digging thru the sources to find out why U-Boot won't start my Linux kernel, I stumbled over lib_arm/bootm.c and its check for the falg variable. I wonder how this ever worked as the condition is really heavy to match unless BOOTM_STATE_OS_GO is 0 which it isn't.

So I guess the patch below is mandatory or you could write an unlikely() around that check ;)

Best regards,
Daniel

lib_arm/bootm.c +1 -1
index 8e264ce..58a101f 100644
@@ -67,7 +67,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
        char *commandline = getenv ("bootargs");
 #endif
 
-       if ((flag != 0) || (flag != BOOTM_STATE_OS_GO))
+       if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
                return 1;
 
        theKernel = (void (*)(int, int, uint))images->ep;
#1 lore raw

PATCH 1/1 fix lib_arm/bootm.c

Quoted 7 lines · Daniel Mack

Hi,

while digging thru the sources to find out why U-Boot won't start my Linux kernel, I stumbled over lib_arm/bootm.c and its check for the falg variable. I wonder how this ever worked as the condition is really heavy to match unless BOOTM_STATE_OS_GO is 0 which it isn't.

Quoted 6 lines

So I guess the patch below is mandatory or you could write an unlikely() around that check ;)

Best regards,
Daniel

please update your local tree

Best Regards,
J.

#2 lore raw

PATCH 1/1 fix lib_arm/bootm.c

In reply to Daniel Mack
Quoted 6 lines · Daniel Mack

Hi,

while digging thru the sources to find out why U-Boot won't start my Linux kernel, I stumbled over lib_arm/bootm.c and its check for the falg variable. I wonder how this ever worked as the condition is really heavy to match unless BOOTM_STATE_OS_GO is 0 which it isn't.

Hi Daniel,

FYI, Peter Pearse found this independently. The patch apparently hasn't been applied to the mainline yet. :-(

<http://article.gmane.org/gmane.comp.boot-loaders.u-boot/49926>

[snip]

Best regards,
gvb

#3 lore raw

PATCH 1/1 fix lib_arm/bootm.c

Quoted 8 lines · Jerry Van Baren
Quoted 6 lines · Daniel Mack

Hi,

while digging thru the sources to find out why U-Boot won't start my Linux kernel, I stumbled over lib_arm/bootm.c and its check for the falg variable. I wonder how this ever worked as the condition is really heavy to match unless BOOTM_STATE_OS_GO is 0 which it isn't.

Quoted 4 lines

Hi Daniel,

FYI, Peter Pearse found this independently. The patch apparently hasn't been applied to the mainline yet. :-(

already in mainline
first found by Ilko Iliev commit 263b749e2e25

Best Regards,
J.

#4 lore raw

PATCH 1/1 fix lib_arm/bootm.c

In reply to Jerry Van Baren
Quoted 10 lines · Jerry Van Baren
Quoted 6 lines · Daniel Mack

Hi,

while digging thru the sources to find out why U-Boot won't start my Linux kernel, I stumbled over lib_arm/bootm.c and its check for the falg variable. I wonder how this ever worked as the condition is really heavy to match unless BOOTM_STATE_OS_GO is 0 which it isn't.

Quoted 4 lines

Hi Daniel,

FYI, Peter Pearse found this independently. The patch apparently hasn't been applied to the mainline yet. :-(

Ilko Iliev's patch is in mainline:

http://git.denx.de/?p=u-boot.git;a=commit;h=263b749e2e25473a48776d317bd2a7e2ddcdd212

Regards

Dirk

Quoted 12 lines

<http://article.gmane.org/gmane.comp.boot-loaders.u-boot/49926>

[snip]

Best regards,
gvb

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot