public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Ruben Ayrapetyan <ruben.ayrapetyan@arm.com>,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] uapi/netfilter: Prefer ISO-friendly __typeof__
Date: Mon, 24 Apr 2023 18:48:35 +0200	[thread overview]
Message-ID: <20230424164835.GA2814761@pevik> (raw)
In-Reply-To: <f8bd4212-9cca-03ca-884a-c9dec63bb256@arm.com>

> On 16/04/2023 23:07, Petr Vorel wrote:
> > typeof() is a GNU extension, UAPI requires ISO C, therefore __typeof__()
> > should be used.  Similarly to b4bd35a19df5 ("uapi/linux/const.h: Prefer
> > ISO-friendly __typeof__") use __typeof__() also in x_tables.h.

> Thanks for finishing up the work!

> Minor thing, the hash for my commit in -next seems to be 31088f6f7906 at
> the moment. As to the Fixes: tag, it looks like it should be (assuming
> that commit already exported the macro):

> Fixes: 72b2b1dd77e8 ("netfilter: xtables: replace XT_ENTRY_ITERATE macro")

> Aside from that, looks good to me, so:

Thank you!

Andrew, I'll just wait for others to comment and then I'll send v2
(so that you don't need to update the work yourself).

Kind regards,
Petr

> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>

> Kevin

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Based on [1] merged into linux-next as b4bd35a19df5.
> > There should be the same Fixes: which we agree in discussion in [1]
> > (likely a79ff731a1b2, or d6fc9fcbaa65).

> > Kind regards,
> > Petr

> > [1] https://lore.kernel.org/lkml/20230411092747.3759032-1-kevin.brodsky@arm.com/


> >  include/uapi/linux/netfilter/x_tables.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)

> > diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h
> > index 796af83a963a..d4eced07f2a2 100644
> > --- a/include/uapi/linux/netfilter/x_tables.h
> > +++ b/include/uapi/linux/netfilter/x_tables.h
> > @@ -172,11 +172,11 @@ struct xt_counters_info {

> >  /* pos is normally a struct ipt_entry/ip6t_entry/etc. */
> >  #define xt_entry_foreach(pos, ehead, esize) \
> > -	for ((pos) = (typeof(pos))(ehead); \
> > -	     (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
> > -	     (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
> > +	for ((pos) = (__typeof__(pos))(ehead); \
> > +	     (pos) < (__typeof__(pos))((char *)(ehead) + (esize)); \
> > +	     (pos) = (__typeof__(pos))((char *)(pos) + (pos)->next_offset))

> > -/* can only be xt_entry_match, so no use of typeof here */
> > +/* can only be xt_entry_match, so no use of __typeof__ here */
> >  #define xt_ematch_foreach(pos, entry) \
> >  	for ((pos) = (struct xt_entry_match *)entry->elems; \
> >  	     (pos) < (struct xt_entry_match *)((char *)(entry) + \


      reply	other threads:[~2023-04-24 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 21:07 [PATCH] uapi/netfilter: Prefer ISO-friendly __typeof__ Petr Vorel
2023-04-24 15:47 ` Kevin Brodsky
2023-04-24 16:48   ` Petr Vorel [this message]

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=20230424164835.GA2814761@pevik \
    --to=pvorel@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=ruben.ayrapetyan@arm.com \
    --cc=sam@ravnborg.org \
    /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