[U-Boot-Users] [PATCH1] Microblaze - mfsl command reparation

Grant Likely grant.likely at secretlab.ca
Tue Sep 11 16:57:59 CEST 2007


On 8/30/07, Michal Simek <Monstr at seznam.cz> wrote:
> Desc: mfsl command reparation

Is this a bug fix?  It's not obvious from the patch or the description.

>
> Signed-off-by: Michal Simek <monstr at monstr.eu>
>
> diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c
> index 8d4c1a3..93cc873 100644
> --- a/common/cmd_mfsl.c
> +++ b/common/cmd_mfsl.c
> @@ -357,7 +357,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
>
>         reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
>         val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
> -       if (argc < 1) {
> +       if (argc < 2) {

Shouldn't the check for the number of arguments occur *before* the
strtoul() calls?

>                 printf ("Usage:\n%s\n", cmdtp->usage);
>                 return 1;
>         }
> @@ -382,6 +382,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
>                 puts ("ESR");
>                 break;
>         default:
> +               puts ("Unsupported register\n");
>                 return 1;
>         }
>         printf (": 0x%08lx\n", val);
> @@ -408,10 +409,10 @@ U_BOOT_CMD (fwr, 4, 1, do_fwr,
>                 " 3 - blocking control write\n");
>
>  U_BOOT_CMD (rspr, 3, 1, do_rspr,
> -               "rmsr    - read/write special purpose register\n",
> +               "rspr    - read/write special purpose register\n",
>                 "- reg_num [write value] read/write special purpose register\n"
> -               " 0 - MSR - Machine status register\n"
> -               " 1 - EAR - Exception address register\n"
> -               " 2 - ESR - Exception status register\n");
> +               " 1 - MSR - Machine status register\n"
> +               " 3 - EAR - Exception address register\n"
> +               " 5 - ESR - Exception status register\n");
>
>  #endif
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195




More information about the U-Boot mailing list