diff options
author | Rutuja Shah <rutu.shah.26@gmail.com> | 2016-03-21 21:32:30 +0530 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:52:22 -0600 |
commit | 89492b974896cf041e346da9ca03cfb5b94423e0 (patch) | |
tree | dc9c94e55c16afa1ab67620faf778c353b28219b /hw/input/tsc2005.c | |
parent | 69fea71f6bf8a4966c4dc7d0a05a0c85671098f3 (diff) | |
download | hqemu-89492b974896cf041e346da9ca03cfb5b94423e0.zip hqemu-89492b974896cf041e346da9ca03cfb5b94423e0.tar.gz |
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/input/tsc2005.c')
-rw-r--r-- | hw/input/tsc2005.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index 8da4887..9b359aa 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -291,7 +291,8 @@ static void tsc2005_pin_update(TSC2005State *s) s->precision = s->nextprecision; s->function = s->nextfunction; s->pdst = !s->pnd0; /* Synchronised on internal clock */ - expires = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() >> 7); + expires = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + + (NANOSECONDS_PER_SECOND >> 7); timer_mod(s->timer, expires); } |