netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: yanhaishuang@cmss.chinamobile.com
Cc: eric.dumazet@gmail.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)
Date: Mon, 23 May 2016 21:09:11 -0700 (PDT)	[thread overview]
Message-ID: <20160523.210911.2013008845670427252.davem@davemloft.net> (raw)
In-Reply-To: <4A265D43-913E-449E-8BA0-80A2B6930AD6@cmss.chinamobile.com>

From: 严海双 <yanhaishuang@cmss.chinamobile.com>
Date: Tue, 24 May 2016 11:55:31 +0800

> 
>> On May 24, 2016, at 11:14 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> 
>> On Tue, 2016-05-24 at 10:39 +0800, Haishuang Yan wrote:
>>> For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6).
>>> 
>>> ---
>>> Changes in v2:
>>>  - Place the "#if IS_ENABLED" block before the "} else if
>>> (..) {" piece and the "#endif" before the closing brace and this
>>> becomes much easier to look at.
>> 
>> _Why_ is this patch needed ?
>> 
>> Please describe in the changelog what _actual_ problem you are trying to
>> address.
>> 
>> We have many points in the kernel using ipv6_get_dsfield() even if
>> CONFIG_IPV6=n, and it seems fine to me at least.
>> 
>> Thanks.
>> 
>> 
>> 
> 
> Yes, you’re right, but I think add this patch seems more reasonable in coding.

No, it isn't more reasonable at all.

We have the backup implementations when CONFIG_IPV6 is disabled
_EXACTLY_ to avoid ifdef crap like this in C files.

      reply	other threads:[~2016-05-24  4:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24  2:39 [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6) Haishuang Yan
2016-05-24  3:14 ` Eric Dumazet
2016-05-24  3:55   ` 严海双
2016-05-24  4:09     ` David Miller [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=20160523.210911.2013008845670427252.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yanhaishuang@cmss.chinamobile.com \
    --cc=yoshfuji@linux-ipv6.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).