On 12/06/2016 19:29, Andrew Jones wrote: > Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx> Reviewed-by: Laurent Vivier <lvivier@xxxxxxxxxx> > --- > lib/powerpc/setup.c | 4 ++-- > powerpc/emulator.c | 2 +- > powerpc/rtas.c | 12 ++++++------ > powerpc/selftest.c | 8 ++++---- > powerpc/spapr_hcall.c | 6 +++--- > 5 files changed, 16 insertions(+), 16 deletions(-) > > diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c > index 353c7d416dfdd..82e1346b4a27c 100644 > --- a/lib/powerpc/setup.c > +++ b/lib/powerpc/setup.c > @@ -20,7 +20,7 @@ > > extern unsigned long stacktop; > extern void io_init(void); > -extern void setup_args(const char *args); > +extern void setup_args_prognam(const char *args); > > u32 cpus[NR_CPUS] = { [0 ... NR_CPUS-1] = (~0U) }; > int nr_cpus; > @@ -164,5 +164,5 @@ void setup(const void *fdt) > > ret = dt_get_bootargs(&bootargs); > assert(ret == 0); > - setup_args(bootargs); > + setup_args_prognam(bootargs); > } > diff --git a/powerpc/emulator.c b/powerpc/emulator.c > index 0e5f7a35cdb7f..04c448014ae9c 100644 > --- a/powerpc/emulator.c > +++ b/powerpc/emulator.c > @@ -354,7 +354,7 @@ int main(int argc, char **argv) > handle_exception(0x700, program_check_handler, (void *)&is_invalid); > handle_exception(0x600, alignment_handler, (void *)&alignment); > > - for (i = 0; i < argc; i++) { > + for (i = 1; i < argc; i++) { > if (strcmp(argv[i], "-v") == 0) { > verbose = 1; > } > diff --git a/powerpc/rtas.c b/powerpc/rtas.c > index 9d673f0ce8d93..1b1e9c753ef1b 100644 > --- a/powerpc/rtas.c > +++ b/powerpc/rtas.c > @@ -115,23 +115,23 @@ int main(int argc, char **argv) > > report_prefix_push("rtas"); > > - if (!argc) > + if (argc < 2) > report_abort("no test specified"); > > - report_prefix_push(argv[0]); > + report_prefix_push(argv[1]); > > - if (strcmp(argv[0], "get-time-of-day") == 0) { > + if (strcmp(argv[1], "get-time-of-day") == 0) { > > - len = parse_keyval(argv[1], &val); > + len = parse_keyval(argv[2], &val); > if (len == -1) { > printf("Missing parameter \"date\"\n"); > abort(); > } > - argv[1][len] = '\0'; > + argv[2][len] = '\0'; > > check_get_time_of_day(val); > > - } else if (strcmp(argv[0], "set-time-of-day") == 0) { > + } else if (strcmp(argv[1], "set-time-of-day") == 0) { > > check_set_time_of_day(); > > diff --git a/powerpc/selftest.c b/powerpc/selftest.c > index 84867e482d2a2..8c5ff0ac889d4 100644 > --- a/powerpc/selftest.c > +++ b/powerpc/selftest.c > @@ -49,14 +49,14 @@ int main(int argc, char **argv) > { > report_prefix_push("selftest"); > > - if (!argc) > + if (argc < 2) > report_abort("no test specified"); > > - report_prefix_push(argv[0]); > + report_prefix_push(argv[1]); > > - if (strcmp(argv[0], "setup") == 0) { > + if (strcmp(argv[1], "setup") == 0) { > > - check_setup(argc-1, &argv[1]); > + check_setup(argc-2, &argv[2]); > > } > > diff --git a/powerpc/spapr_hcall.c b/powerpc/spapr_hcall.c > index dbff63013297b..656aaff61405b 100644 > --- a/powerpc/spapr_hcall.c > +++ b/powerpc/spapr_hcall.c > @@ -154,13 +154,13 @@ int main(int argc, char **argv) > > report_prefix_push("hypercall"); > > - if (!argc || (argc == 1 && !strcmp(argv[0], "all"))) > + if (argc < 2 || (argc == 2 && !strcmp(argv[1], "all"))) > all = 1; > > for (i = 0; hctests[i].name != NULL; i++) { > report_prefix_push(hctests[i].name); > - if (all || strcmp(argv[0], hctests[i].name) == 0) { > - hctests[i].func(argc, argv); > + if (all || strcmp(argv[1], hctests[i].name) == 0) { > + hctests[i].func(argc-1, &argv[1]); > } > report_prefix_pop(); > } > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html