Received: from eggs.gnu.org ([2001:4830:134:3::10]:60451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD0xg-0003ha-1w for qemu-devel@nongnu.org; Mon, 10 Feb 2014 19:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WD0xZ-0004oH-Mw for qemu-devel@nongnu.org; Mon, 10 Feb 2014 19:12:27 -0500 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:32872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD0xZ-0004o6-DL for qemu-devel@nongnu.org; Mon, 10 Feb 2014 19:12:21 -0500 Received: by mail-pd0-f173.google.com with SMTP id y10so6764925pdj.4 for ; Mon, 10 Feb 2014 16:12:20 -0800 (PST) Sender: "joel.stan@gmail.com" From: Joel Stanley Date: Tue, 11 Feb 2014 10:42:02 +1030 Message-Id: <1392077522-11903-1-git-send-email-joel@jms.id.au> Subject: [Qemu-devel] [PATCH] virtio-net: remove function calls from assert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@amazon.com, mst@redhat.com peer_{de,at}tach were called from inside assert(). This will be a problem for virtio-net if built with NDEBUG. Signed-off-by: Joel Stanley --- hw/net/virtio-net.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3626608..535948d 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -401,12 +401,15 @@ static int peer_detach(VirtIONet *n, int index) static void virtio_net_set_queues(VirtIONet *n) { int i; + int r; for (i = 0; i < n->max_queues; i++) { if (i < n->curr_queues) { - assert(!peer_attach(n, i)); + r = peer_attach(n, i); + assert(!r); } else { - assert(!peer_detach(n, i)); + r = peer_detach(n, i); + assert(!r); } } } -- 1.9.rc1