]> Git Repo - qemu.git/commitdiff
qemu-timer: reuse MIN macro in qemu_timeout_ns_to_ms
authorFrediano Ziglio <[email protected]>
Wed, 23 Oct 2019 12:26:52 +0000 (13:26 +0100)
committerLaurent Vivier <[email protected]>
Thu, 24 Oct 2019 18:10:18 +0000 (20:10 +0200)
Signed-off-by: Frediano Ziglio <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Message-Id: <20191023122652[email protected]>
[lv: removed the two useless casts]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
util/qemu-timer.c

index d428fec5677258b18f0d2d4bb1923a80fac69d94..ef52d28d3753302bd371eb8965aed8aa9462ae95 100644 (file)
@@ -322,11 +322,7 @@ int qemu_timeout_ns_to_ms(int64_t ns)
     ms = DIV_ROUND_UP(ns, SCALE_MS);
 
     /* To avoid overflow problems, limit this to 2^31, i.e. approx 25 days */
-    if (ms > (int64_t) INT32_MAX) {
-        ms = INT32_MAX;
-    }
-
-    return (int) ms;
+    return MIN(ms, INT32_MAX);
 }
 
 
This page took 0.026741 seconds and 4 git commands to generate.