All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, Rosen Xu <rosen.xu@altera.com>
Subject: Re: [PATCH] raw/ifpga: fix comma warnings
Date: Thu, 12 Mar 2026 09:03:03 -0700	[thread overview]
Message-ID: <20260312090303.359d871a@phoenix.local> (raw)
In-Reply-To: <abKELl_UQ8uLhSTY@bricha3-mobl1.ger.corp.intel.com>

On Thu, 12 Mar 2026 09:15:26 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Wed, Mar 11, 2026 at 05:23:36PM -0700, Stephen Hemminger wrote:
> > 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
> > +  
> 
> I am curious as to how this is not causing warnings but the original code
> is. Have we got builds where we are triggering this macro definition, or is
> ever build tested already got the define?

You have to ask to enable comma warnings, I think it is currently disabled
at the driver level.

  reply	other threads:[~2026-03-12 16:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20260312090303.359d871a@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.