]> git.sur5r.net Git - u-boot/commitdiff
cmd: fdt: Narrow the check for fdt addr
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 5 Jul 2016 08:26:34 +0000 (10:26 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 20 Aug 2016 15:34:58 +0000 (11:34 -0400)
The current code only checks if the fdt subcommand is fdt addr by checking
whether it starts with 'a'.

Since this is a pretty widely used letter, narrow down that check a bit.

Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
cmd/fdt.c

index 898217ffe5f8b2a0f5cf0d32ef635b0bc935a01a..0f5923e75a41f45139314ce9408af06c749ea42e 100644 (file)
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -87,7 +87,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        /*
         * Set the address of the fdt
         */
-       if (argv[1][0] == 'a') {
+       if (strncmp(argv[1], "ad", 2) == 0) {
                unsigned long addr;
                int control = 0;
                struct fdt_header *blob;