Skip to content

Commit

Permalink
i8254: use QEMU_ALIGN_DOWN
Browse files Browse the repository at this point in the history
I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
elmarco committed Aug 31, 2017
1 parent 33c5793 commit ec34748
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/timer/i8254_common.c
Expand Up @@ -93,15 +93,15 @@ int64_t pit_get_next_transition_time(PITChannelState *s, int64_t current_time)
}
break;
case 2:
base = (d / s->count) * s->count;
base = QEMU_ALIGN_DOWN(d, s->count);
if ((d - base) == 0 && d != 0) {
next_time = base + s->count;
} else {
next_time = base + s->count + 1;
}
break;
case 3:
base = (d / s->count) * s->count;
base = QEMU_ALIGN_DOWN(d, s->count);
period2 = ((s->count + 1) >> 1);
if ((d - base) < period2) {
next_time = base + period2;
Expand Down

0 comments on commit ec34748

Please sign in to comment.