misc: move to new pool_foreach macros
Type: refactor
Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/devices/virtio/cli.c b/src/vnet/devices/virtio/cli.c
index 05f9eab..a783369 100644
--- a/src/vnet/devices/virtio/cli.c
+++ b/src/vnet/devices/virtio/cli.c
@@ -231,9 +231,8 @@
if (vec_len (hw_if_indices) == 0)
{
- pool_foreach (vif, vim->interfaces,
- vec_add1 (hw_if_indices, vif->hw_if_index);
- );
+ pool_foreach (vif, vim->interfaces)
+ vec_add1 (hw_if_indices, vif->hw_if_index);
}
else if (show_device_config)
{
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c
index 785ca48..93ea70b 100644
--- a/src/vnet/devices/virtio/pci.c
+++ b/src/vnet/devices/virtio/pci.c
@@ -1352,7 +1352,7 @@
u32 interrupt_count = 0;
/* *INDENT-OFF* */
- pool_foreach (vif, vim->interfaces, ({
+ pool_foreach (vif, vim->interfaces) {
if (vif->pci_addr.as_u32 == args->addr)
{
args->rv = VNET_API_ERROR_ADDRESS_IN_USE;
@@ -1363,7 +1363,7 @@
" PCI address in use");
return;
}
- }));
+ }
/* *INDENT-ON* */
pool_get (vim->interfaces, vif);
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index f7cecef..45897b6 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -1126,7 +1126,7 @@
case ~0:
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
next_timeout = timeout;
for (qid = 0; qid < VHOST_VRING_MAX_N / 2; qid += 2)
{
@@ -1154,7 +1154,7 @@
if ((next_timeout < timeout) && (next_timeout > 0.0))
timeout = next_timeout;
}
- });
+ }
/* *INDENT-ON* */
break;
@@ -1205,7 +1205,7 @@
timeout = 3.0;
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
if (vui->unix_server_index == ~0) { //Nothing to do for server sockets
if (vui->clib_file_index == ~0)
@@ -1273,7 +1273,7 @@
}
}
}
- });
+ }
/* *INDENT-ON* */
}
return 0;
@@ -1408,9 +1408,9 @@
vlib_worker_thread_barrier_sync (vlib_get_main ());
/* *INDENT-OFF* */
- pool_foreach (vui, vum->vhost_user_interfaces, {
+ pool_foreach (vui, vum->vhost_user_interfaces) {
vhost_user_delete_if (vnm, vm, vui->sw_if_index);
- });
+ }
/* *INDENT-ON* */
vlib_worker_thread_barrier_release (vlib_get_main ());
return 0;
@@ -1832,9 +1832,8 @@
if (!out_vuids)
return -1;
- pool_foreach (vui, vum->vhost_user_interfaces,
- vec_add1 (hw_if_indices, vui->hw_if_index);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ vec_add1 (hw_if_indices, vui->hw_if_index);
for (i = 0; i < vec_len (hw_if_indices); i++)
{
@@ -2110,9 +2109,8 @@
}
if (vec_len (hw_if_indices) == 0)
{
- pool_foreach (vui, vum->vhost_user_interfaces,
- vec_add1 (hw_if_indices, vui->hw_if_index);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ vec_add1 (hw_if_indices, vui->hw_if_index);
}
vlib_cli_output (vm, "Virtio vhost-user interfaces");
vlib_cli_output (vm, "Global:\n coalesce frames %d time %e",
@@ -2509,9 +2507,8 @@
if (vum->dont_dump_vhost_user_memory)
{
- pool_foreach (vui, vum->vhost_user_interfaces,
- unmap_all_mem_regions (vui);
- );
+ pool_foreach (vui, vum->vhost_user_interfaces)
+ unmap_all_mem_regions (vui);
}
}
diff --git a/src/vnet/devices/virtio/virtio_api.c b/src/vnet/devices/virtio/virtio_api.c
index bd72284..4d0b663 100644
--- a/src/vnet/devices/virtio/virtio_api.c
+++ b/src/vnet/devices/virtio/virtio_api.c
@@ -232,14 +232,13 @@
if (!reg)
return;
- pool_foreach (vif, vmx->interfaces, (
- {
- if (vif->type == VIRTIO_IF_TYPE_PCI)
- {
- virtio_pci_send_sw_interface_details
- (am, reg, vif, mp->context);}
- }
- ));
+ pool_foreach (vif, vmx->interfaces)
+ {
+ if (vif->type == VIRTIO_IF_TYPE_PCI)
+ {
+ virtio_pci_send_sw_interface_details (am, reg, vif, mp->context);
+ }
+ }
}
#define vl_msg_name_crc_list
diff --git a/src/vnet/devices/virtio/virtio_process.c b/src/vnet/devices/virtio/virtio_process.c
index 7a25611..1689459 100644
--- a/src/vnet/devices/virtio/virtio_process.c
+++ b/src/vnet/devices/virtio/virtio_process.c
@@ -46,7 +46,7 @@
case ~0:
/* *INDENT-OFF* */
- pool_foreach (vif, vim->interfaces, {
+ pool_foreach (vif, vim->interfaces) {
if (vif->packet_coalesce || vif->packet_buffering)
{
virtio_vring_t *vring;
@@ -59,7 +59,7 @@
RX_QUEUE_ACCESS (vring->queue_id));
}
}
- });
+ }
/* *INDENT-ON* */
break;