mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qemu-timer: Use DIV_ROUND_UP
Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
b1b2db29bd
commit
5029b969d1
1 changed files with 1 additions and 1 deletions
|
@ -292,7 +292,7 @@ int qemu_timeout_ns_to_ms(int64_t ns)
|
|||
/* Always round up, because it's better to wait too long than to wait too
|
||||
* little and effectively busy-wait
|
||||
*/
|
||||
ms = (ns + SCALE_MS - 1) / SCALE_MS;
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue