diff options
author | Rutuja Shah <rutu.shah.26@gmail.com> | 2016-03-21 21:32:30 +0530 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-22 22:20:17 +0100 |
commit | 73bcb24d932912f8e75e1d88da0fc0ac6d4bce78 (patch) | |
tree | 50ca9c81024707f16dfc7cfe60b1e52c1dd0b9c2 /hw/display | |
parent | 4771d756f46219762477aaeaaef9bd215e3d5c60 (diff) |
Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND
This patch replaces get_ticks_per_sec() calls with the macro
NANOSECONDS_PER_SECOND. Also, as there are no callers, get_ticks_per_sec()
is then removed. This replacement improves the readability and
understandability of code.
For example,
timer_mod(fdctrl->result_timer,
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() / 50));
NANOSECONDS_PER_SECOND makes it obvious that qemu_clock_get_ns
matches the unit of the expression on the right side of the plus.
Signed-off-by: Rutuja Shah <rutu.shah.26@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/display')
-rw-r--r-- | hw/display/vga.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c index 25dc978b95..657e9f196d 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -236,9 +236,9 @@ static void vga_precise_update_retrace_info(VGACommonState *s) r->total_chars = vtotal_lines * htotal_chars; if (r->freq) { - r->ticks_per_char = get_ticks_per_sec() / (r->total_chars * r->freq); + r->ticks_per_char = NANOSECONDS_PER_SECOND / (r->total_chars * r->freq); } else { - r->ticks_per_char = get_ticks_per_sec() / chars_per_sec; + r->ticks_per_char = NANOSECONDS_PER_SECOND / chars_per_sec; } r->vstart = vretr_start_line; @@ -266,7 +266,7 @@ static void vga_precise_update_retrace_info(VGACommonState *s) "dots = %d\n" "ticks/char = %" PRId64 "\n" "\n", - (double) get_ticks_per_sec() / (r->ticks_per_char * r->total_chars), + (double) NANOSECONDS_PER_SECOND / (r->ticks_per_char * r->total_chars), htotal_chars, hretr_start_char, hretr_skew_chars, |