Skip to content

Commit

Permalink
net: remove muldiv64()
Browse files Browse the repository at this point in the history
muldiv64() is used to convert nanoseconds to microseconds.

    x = muldiv64(qemu_clock_get_ns(..), 1000000, get_ticks_per_sec());

As  get_ticks_per_sec() is 10^9, it can be replaced by:

    x = qemu_clock_get_us(..);

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
vivier committed Sep 25, 2015
1 parent fdfea12 commit ab60b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dump.c
Expand Up @@ -69,7 +69,7 @@ static ssize_t dump_receive(NetClientState *nc, const uint8_t *buf, size_t size)
return size;
}

ts = muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), 1000000, get_ticks_per_sec());
ts = qemu_clock_get_us(QEMU_CLOCK_VIRTUAL);
caplen = size > s->pcap_caplen ? s->pcap_caplen : size;

hdr.ts.tv_sec = ts / 1000000 + s->start_ts;
Expand Down

0 comments on commit ab60b74

Please sign in to comment.