From: Joel Stanley Date: Tue, 11 Feb 2014 00:12:02 +0000 (+1030) Subject: virtio-net: remove function calls from assert X-Git-Tag: v2.0.0-rc0~26^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddfa83ea06680e83643978f6ecf740b60f86f7c2;p=thirdparty%2Fqemu.git virtio-net: remove function calls from assert 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 --- diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3c0342e17a8..fd23c4627e7 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); } } }