misc: move to new pool_foreach macros
[vpp.git] / src / plugins / gbp / gbp_endpoint_group.c
index 19c05f9..b904437 100644 (file)
@@ -52,11 +52,14 @@ gbp_endpoint_group_get (index_t i)
 }
 
 void
-gbp_endpoint_group_lock (index_t i)
+gbp_endpoint_group_lock (index_t ggi)
 {
   gbp_endpoint_group_t *gg;
 
-  gg = gbp_endpoint_group_get (i);
+  if (INDEX_INVALID == ggi)
+    return;
+
+  gg = gbp_endpoint_group_get (ggi);
   gg->gg_locks++;
 }
 
@@ -238,11 +241,11 @@ gbp_endpoint_group_walk (gbp_endpoint_group_cb_t cb, void *ctx)
   gbp_endpoint_group_t *gbpe;
 
   /* *INDENT-OFF* */
-  pool_foreach(gbpe, gbp_endpoint_group_pool,
+  pool_foreach (gbpe, gbp_endpoint_group_pool)
   {
     if (!cb(gbpe, ctx))
       break;
-  });
+  }
   /* *INDENT-ON* */
 }