From: Andrew Lunn <andrew@lunn.ch>
To: David Howells <dhowells@redhat.com>
Cc: netdev@vger.kernel.org, kernel test robot <lkp@intel.com>,
Marc Dionne <marc.dionne@auristor.com>,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] rxrpc: Fix missing IPV6 #ifdef
Date: Thu, 10 Nov 2022 16:37:41 +0100 [thread overview]
Message-ID: <Y20axWysgRAwJsxc@lunn.ch> (raw)
In-Reply-To: <3080953.1668089385@warthog.procyon.org.uk>
On Thu, Nov 10, 2022 at 02:09:45PM +0000, David Howells wrote:
> Andrew Lunn <andrew@lunn.ch> wrote:
>
> > > +#ifdef CONFIG_AF_RXRPC_IPV6
> > > return ipv6_icmp_error(sk, skb, err, port, info, payload);
> > > +#endif
> >
> > Can this be if (IS_ENABLED(CONFIG_AF_RXRPC_IPV6) {} rather than
> > #ifdef? It gives better build testing.
>
> Sure. Does it actually make that much of a difference? I guess the
> declaration is there even if IPV6 is disabled.
And that is the point. Even if this feature is disabled, the type
checking will be performed, the number of parameters etc. Somebody who
modifies ipv6_icmp_error() is going to find problems with a single
compilation, rather than having to use a big collection of random
configs.
So this is a review comment i often make. Avoid #ifdef if you can, use
IS_ENABLED() inside an if statement.
Andrew
prev parent reply other threads:[~2022-11-10 15:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 9:43 [PATCH net-next] rxrpc: Fix missing IPV6 #ifdef David Howells
2022-11-10 10:42 ` Hideaki Yoshifuji
2022-11-10 13:26 ` David Howells
2022-11-10 13:47 ` Andrew Lunn
2022-11-10 14:09 ` David Howells
2022-11-10 15:37 ` Andrew Lunn [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=Y20axWysgRAwJsxc@lunn.ch \
--to=andrew@lunn.ch \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).