[U-Boot] [PATCH v2 06/23] Update time command to avoid using get_timer_masked()

Simon Glass sjg at chromium.org
Thu Dec 6 01:48:12 CET 2012


Hi,

On Thu, Nov 22, 2012 at 11:12 AM, Simon Glass <sjg at chromium.org> wrote:
> It is better to use get_timer() by itself now, according to the new
> timer API.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> Changes in v2: None

I am going to drop this patch as Richard Genoud has refactored the
code in a pending patch, so I don't think this is needed.

Regards,
Simon

>
>  common/cmd_time.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/common/cmd_time.c b/common/cmd_time.c
> index 6dbdbbf..f1891f9 100644
> --- a/common/cmd_time.c
> +++ b/common/cmd_time.c
> @@ -32,6 +32,7 @@ static int run_command_and_time_it(int flag, int argc, char * const argv[],
>  {
>         cmd_tbl_t *cmdtp = find_cmd(argv[0]);
>         int retval = 0;
> +       ulong start;
>
>         if (!cmdtp) {
>                 printf("%s: command not found\n", argv[0]);
> @@ -45,9 +46,9 @@ static int run_command_and_time_it(int flag, int argc, char * const argv[],
>          * boards.  We could use the new timer API that Graeme is proposing
>          * so that this piece of code would be arch-independent.
>          */
> -       *cycles = get_timer_masked();
> +       start = get_timer(0);
>         retval = cmdtp->cmd(cmdtp, flag, argc, argv);
> -       *cycles = get_timer_masked() - *cycles;
> +       *cycles = get_timer(start);
>
>         return retval;
>  }
> --
> 1.7.7.3
>


More information about the U-Boot mailing list