Le 23/10/2019 à 14:26, Frediano Ziglio a écrit : > Signed-off-by: Frediano Ziglio <fzig...@redhat.com> > --- > util/qemu-timer.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/util/qemu-timer.c b/util/qemu-timer.c > index d428fec567..094a20a05a 100644 > --- a/util/qemu-timer.c > +++ b/util/qemu-timer.c > @@ -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 (int) MIN(ms, (int64_t) INT32_MAX); > } > > >
Applied to my trivial-patches branch. I've updated the patch to remove the two useless casts. Eric, if you want to add your R-b, I can add it to the queued patch. Thanks, Laurent