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 <joel@jms.id.au> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6cb46e1e90
commit
ddfa83ea06
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user