]> git.sur5r.net Git - openocd/blobdiff - src/target/xscale.c
Use timeval helpers
[openocd] / src / target / xscale.c
index 8fe8a2cb9939f1052fe63d5bdcc1c5d61042cb9f..87a3d0f78d69e9bde71337b58c733a8928329f23 100644 (file)
@@ -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;
                }