public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] raw/ifpga: fix comma warnings
@ 2026-03-12  0:23 Stephen Hemminger
  2026-03-12  9:15 ` Bruce Richardson
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2026-03-12  0:23 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Rosen Xu

The driver was open coding TAILQ_FOREACH_SAFE() in a manner
that triggered warnings. Replace it with the standard one
from bsd queue.h.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/raw/ifpga/base/ifpga_enumerate.c | 4 +---
 drivers/raw/ifpga/base/opae_hw_api.h     | 7 +++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/raw/ifpga/base/ifpga_enumerate.c b/drivers/raw/ifpga/base/ifpga_enumerate.c
index 61eb6601ea..085fb6db40 100644
--- a/drivers/raw/ifpga/base/ifpga_enumerate.c
+++ b/drivers/raw/ifpga/base/ifpga_enumerate.c
@@ -725,9 +725,7 @@ static void dfl_fpga_enum_info_free(struct dfl_fpga_enum_info *info)
 		return;
 
 	/* remove all device feature lists in the list. */
-	for (dfl = TAILQ_FIRST(&info->dfls);
-		dfl && (tmp = TAILQ_NEXT(dfl, node), 1);
-		dfl = tmp) {
+	TAILQ_FOREACH_SAFE(dfl, &info->dfls, node, tmp) {
 		TAILQ_REMOVE(&info->dfls, dfl, node);
 		opae_free(dfl);
 	}
diff --git a/drivers/raw/ifpga/base/opae_hw_api.h b/drivers/raw/ifpga/base/opae_hw_api.h
index 57750022dd..63cb616731 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.h
+++ b/drivers/raw/ifpga/base/opae_hw_api.h
@@ -10,6 +10,13 @@
 #include <stdio.h>
 #include <sys/queue.h>
 
+#ifndef TAILQ_FOREACH_SAFE
+#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = TAILQ_FIRST((head));				\
+	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+#endif
+
 #include "opae_osdep.h"
 #include "opae_intel_max10.h"
 #include "opae_eth_group.h"
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-12 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  0:23 [PATCH] raw/ifpga: fix comma warnings Stephen Hemminger
2026-03-12  9:15 ` Bruce Richardson
2026-03-12 16:03   ` Stephen Hemminger
2026-03-12 16:28     ` Bruce Richardson
2026-03-12 16:33       ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox