[U-Boot] Env var initrd_high - logic reversed in check?

Peter Howard pjh at northern-ridge.com.au
Sun Jun 19 05:34:21 CEST 2016


Hi all,

I've been trying to stop my initrd being relocated duing a bootm
process, and ended up at this bit of code in common/image.c (starting
line 1135):


        if ((s = getenv("initrd_high")) != NULL) {
                /* a value of "no" or a similar string will act like 0,
                 * turning the "load high" feature off. This is intentional.
                 */
                initrd_high = simple_strtoul(s, NULL, 16);
                if (initrd_high == ~0)
                        initrd_copy_to_ram = 0;
        } else {
                initrd_high = getenv_bootm_mapsize() + getenv_bootm_low();
        }

The check - "if (initrd_high == ~0)" seems wrong - based on the comment
an value of "no" for initrd_high gets interpreted as 0.  But the test
is effectively for 0xffffffff (or 0xffffffffffffffff).   Assuming the
comment is correct, shouldn't the check be against 0 rather than ~0 ?

Thanks


-- 
Peter Howard <pjh at northern-ridge.com.au>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160619/9c578f4b/attachment.sig>


More information about the U-Boot mailing list