Message ID | 1459794307-30363-2-git-send-email-maxime.ripard@free-electrons.com |
---|---|
State | Superseded |
Delegated to: | Pantelis Antoniou |
Headers | show |
On 4 April 2016 at 12:25, Maxime Ripard <maxime.ripard@free-electrons.com> wrote: > 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. > > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> > --- > cmd/fdt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/fdt.c b/cmd/fdt.c index 4c18962d8532..ca6c707dfb48 100644 --- 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;
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. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> --- cmd/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)