X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fxscale.c;h=87a3d0f78d69e9bde71337b58c733a8928329f23;hp=8fe8a2cb9939f1052fe63d5bdcc1c5d61042cb9f;hb=2428722a23d8a08b15331ab95884762e5f329a02;hpb=47b8cf84202bf792cf66fbfa01169e9592236b8a diff --git a/src/target/xscale.c b/src/target/xscale.c index 8fe8a2cb99..87a3d0f78d 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -404,8 +404,7 @@ static int xscale_read_tx(struct target *target, int consume) } gettimeofday(&now, NULL); - if ((now.tv_sec > timeout.tv_sec) || - ((now.tv_sec == timeout.tv_sec) && (now.tv_usec > timeout.tv_usec))) { + if (timeval_compare(&now, &timeout) > 0) { LOG_ERROR("time out reading TX register"); return ERROR_TARGET_TIMEOUT; }