All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: David Miller <davem@davemloft.net>
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: Fri, 14 Sep 2018 13:13:00 +0800	[thread overview]
Message-ID: <5B9B435C.4020300@huawei.com> (raw)
In-Reply-To: <20180913.104254.1048729520825977993.davem@davemloft.net>

On 2018/9/14 1:42, David Miller wrote:
> 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.
>
> .
>
Get it.  Thank you for your explanation.

Sincerely,
zhong jiang


      reply	other threads:[~2018-09-14  5:13 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
2018-09-14  5:13   ` zhong jiang [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=5B9B435C.4020300@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.