From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMjGJ-0003Ge-Dy for qemu-devel@nongnu.org; Sun, 09 Mar 2014 15:19:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMjGE-0004cs-EJ for qemu-devel@nongnu.org; Sun, 09 Mar 2014 15:19:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMjGE-0004cn-6v for qemu-devel@nongnu.org; Sun, 09 Mar 2014 15:19:46 -0400 Date: Sun, 9 Mar 2014 21:19:42 +0200 From: "Michael S. Tsirkin" Message-ID: <1394392713-31471-4-git-send-email-mst@redhat.com> References: <1394392713-31471-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394392713-31471-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v3 03/14] 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: Peter Maydell , Joel Stanley , Anthony Liguori From: Joel Stanley peer_{de,at}tach were called from inside assert(). We don't support building without NDEBUG but it's not tidy. Rearrange to attach peer outside assert calls. Signed-off-by: Joel Stanley Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 3c0342e..fd23c46 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -397,12 +397,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); } } } -- MST