diff options
| author | Fangrui Song <i@maskray.me> | 2019-11-22 09:00:38 +0100 |
|---|---|---|
| committer | Juan Quintela <quintela@redhat.com> | 2020-01-20 09:10:22 +0100 |
| commit | 2667c98722ddec12c9f43902c6c5668023e1dce9 (patch) | |
| tree | 0e879bea120b85f74e2e4c4607f1f31c96e53729 /hw/timer/arm_timer.c | |
| parent | 97e1e06780e70f6e98a0d2df881e0c0927d3aeb6 (diff) | |
| download | focaccia-qemu-2667c98722ddec12c9f43902c6c5668023e1dce9.tar.gz focaccia-qemu-2667c98722ddec12c9f43902c6c5668023e1dce9.zip | |
migration: Fix incorrect integer->float conversion caught by clang
Clang does not like qmp_migrate_set_downtime()'s code to clamp double
@value to 0..INT64_MAX:
qemu/migration/migration.c:2038:24: error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
The warning will be enabled by default in clang 10. It is not
available for clang <= 9.
The clamp is actually useless; @value is checked to be within
0..MAX_MIGRATE_DOWNTIME_SECONDS immediately before. Delete it.
While there, make the conversion from double to int64_t explicit.
Signed-off-by: Fangrui Song <i@maskray.me>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Patch split, commit message improved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/timer/arm_timer.c')
0 files changed, 0 insertions, 0 deletions