Fix usage of timeval_ms()

First, fix the timeval_ms() implementation to not have K&R but ANSI
argument semantics by adding a missing void.

timeval_ms() returns an int64_t, not uint64_t or long long. Consistently
use int64_t for variables and PRI*64 as format string.

While at it, change a few related variables to bool for clarity.

Note that timeval_ms() may return a negative error code, but not a
single caller checks for that.

Change-Id: I27cf83e75b3e9a8913f6c43e98a281bea77aac13
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3499
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Andreas Färber
2016-05-22 04:34:04 +02:00
committed by Andreas Fritiofson
parent f4496b25e3
commit f19ac83152
26 changed files with 64 additions and 64 deletions

View File

@@ -106,7 +106,7 @@ static int ssp_setcs(struct target *target, uint32_t io_base, unsigned int value
* and the controller is idle. */
static int poll_ssp_busy(struct target *target, uint32_t ssp_base, int timeout)
{
long long endtime;
int64_t endtime;
uint32_t value;
int retval;
@@ -325,7 +325,7 @@ static int wait_till_ready(struct flash_bank *bank, int timeout)
{
uint32_t status;
int retval;
long long endtime;
int64_t endtime;
endtime = timeval_ms() + timeout;
do {