From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Rosen Xu <rosen.xu@altera.com>
Subject: [PATCH] raw/ifpga: fix comma warnings
Date: Wed, 11 Mar 2026 17:23:36 -0700 [thread overview]
Message-ID: <20260312002337.867771-1-stephen@networkplumber.org> (raw)
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
next reply other threads:[~2026-03-12 0:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 0:23 Stephen Hemminger [this message]
2026-03-12 9:15 ` [PATCH] raw/ifpga: fix comma warnings Bruce Richardson
2026-03-12 16:03 ` Stephen Hemminger
2026-03-12 16:28 ` Bruce Richardson
2026-03-12 16:33 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260312002337.867771-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=rosen.xu@altera.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox