linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: zhongjiang@huawei.com
Cc: edumazet@google.com, kuznet@ms2.inr.ac.ru,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2] net: ipv4: Use BUG_ON directly instead of a if condition followed by BUG
Date: Thu, 13 Sep 2018 10:42:54 -0700 (PDT)	[thread overview]
Message-ID: <20180913.104254.1048729520825977993.davem@davemloft.net> (raw)
In-Reply-To: <1536671593-14746-1-git-send-email-zhongjiang@huawei.com>

From: zhong jiang <zhongjiang@huawei.com>
Date: Tue, 11 Sep 2018 21:13:13 +0800

> The if condition can be removed if we use BUG_ON directly.
> The issule is detected with the help of Coccinelle.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Taking Simon's feedback into consideration...

I very often see changes like this and have to check the implementation
of BUG_ON() et al. to make sure it evaluates it's arguments even when
debugging is disabled.

Even if it is always guaranteed to do so, like me people will be unsure
forever and have to check.

That makes auditing code and validating things more time consuming and
hard.

I also think the code as written now looks a lot nicer.

So I'm not applying this, sorry.

  parent reply	other threads:[~2018-09-13 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 13:13 [PATCHv2] net: ipv4: Use BUG_ON directly instead of a if condition followed by BUG zhong jiang
2018-09-13 10:28 ` Simon Horman
2018-09-13 17:42 ` David Miller [this message]
2018-09-14  5:13   ` zhong jiang

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=20180913.104254.1048729520825977993.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zhongjiang@huawei.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;
as well as URLs for NNTP newsgroup(s).