From patchwork Tue Aug 25 20:44:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 510618 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A3ED114010F for ; Wed, 26 Aug 2015 06:46:03 +1000 (AEST) Received: from localhost ([::1]:34491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUL6X-0005kr-Qa for incoming@patchwork.ozlabs.org; Tue, 25 Aug 2015 16:46:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUL5d-0004Qw-1V for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUL5c-0000U9-9A for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:45:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUL5c-0000Sq-4r for qemu-devel@nongnu.org; Tue, 25 Aug 2015 16:45:04 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D44548E379 for ; Tue, 25 Aug 2015 20:45:03 +0000 (UTC) Received: from thinkpad.redhat.com (vpn1-5-196.ams2.redhat.com [10.36.5.196]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7PKipFs030113; Tue, 25 Aug 2015 16:45:02 -0400 From: Laurent Vivier To: qemu-devel@nongnu.org, Stefan Hajnoczi , Jason Wang Date: Tue, 25 Aug 2015 22:44:51 +0200 Message-Id: <1440535491-4511-8-git-send-email-lvivier@redhat.com> In-Reply-To: <1440535491-4511-1-git-send-email-lvivier@redhat.com> References: <1440535491-4511-1-git-send-email-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/7] net: remove muldiv64() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org muldiv64() is used to convert nanoseconds to microseconds. x = muldiv64(y, 1000000, get_ticks_per_sec()); As get_ticks_per_sec() is 10^9, it can be replaced by: x = y / 1000; Signed-off-by: Laurent Vivier --- net/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dump.c b/net/dump.c index 02c8064..0eb032d 100644 --- a/net/dump.c +++ b/net/dump.c @@ -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_ns(QEMU_CLOCK_VIRTUAL) / 1000; /* nsec -> usec */ caplen = size > s->pcap_caplen ? s->pcap_caplen : size; hdr.ts.tv_sec = ts / 1000000 + s->start_ts;