提交 ddfa83ea 编写于 作者: J Joel Stanley 提交者: Michael S. Tsirkin

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: NJoel Stanley <joel@jms.id.au>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 6cb46e1e
......@@ -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);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册