Patchwork [U-Boot,08/17] Update time command to avoid using get_timer_masked()

login
register
mail settings
Submitter Simon Glass
Date Nov. 3, 2012, 12:27 a.m.
Message ID <1351902453-27956-9-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/196782/
State Superseded, archived
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - Nov. 3, 2012, 12:27 a.m.
It is better to use get_timer() by itself now, according to the new
timer API.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/cmd_time.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch

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;
 }