提交 5bd34354 编写于 作者: F Frediano Ziglio 提交者: Laurent Vivier

qemu-timer: reuse MIN macro in qemu_timeout_ns_to_ms

Signed-off-by: NFrediano Ziglio <fziglio@redhat.com>
Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
Message-Id: <20191023122652.2999-3-fziglio@redhat.com>
[lv: removed the two useless casts]
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
上级 105e1023
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册