aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/tusb6010.c
diff options
context:
space:
mode:
authorRutuja Shah <rutu.shah.26@gmail.com>2016-03-21 21:32:30 +0530
committerPaolo Bonzini <pbonzini@redhat.com>2016-03-22 22:20:17 +0100
commit73bcb24d932912f8e75e1d88da0fc0ac6d4bce78 (patch)
tree50ca9c81024707f16dfc7cfe60b1e52c1dd0b9c2 /hw/usb/tusb6010.c
parent4771d756f46219762477aaeaaef9bd215e3d5c60 (diff)
downloadqemu-73bcb24d932912f8e75e1d88da0fc0ac6d4bce78.zip
qemu-73bcb24d932912f8e75e1d88da0fc0ac6d4bce78.tar.gz
qemu-73bcb24d932912f8e75e1d88da0fc0ac6d4bce78.tar.bz2
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/usb/tusb6010.c')
-rw-r--r--hw/usb/tusb6010.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 9f6af90..8f593a6 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -516,7 +516,7 @@ static void tusb_async_writew(void *opaque, hwaddr addr,
if (value & TUSB_DEV_OTG_TIMER_ENABLE)
timer_mod(s->otg_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
muldiv64(TUSB_DEV_OTG_TIMER_VAL(value),
- get_ticks_per_sec(), TUSB_DEVCLOCK));
+ NANOSECONDS_PER_SECOND, TUSB_DEVCLOCK));
else
timer_del(s->otg_timer);
break;
@@ -726,8 +726,8 @@ static void tusb6010_power(TUSBState *s, int on)
/* Pull the interrupt down after TUSB6010 comes up. */
s->intr_ok = 0;
tusb_intr_update(s);
- timer_mod(s->pwr_timer,
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + get_ticks_per_sec() / 2);
+ timer_mod(s->pwr_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
+ NANOSECONDS_PER_SECOND / 2);
}
}