From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG
Date: Mon, 23 Oct 2017 21:01:46 -0700 [thread overview]
Message-ID: <20171024040144.bf2cvq7p6zwg2e5k@ast-mbp> (raw)
In-Reply-To: <20171024035320.GA29795@gondor.apana.org.au>
On Tue, Oct 24, 2017 at 11:53:20AM +0800, Herbert Xu wrote:
> On Mon, Oct 23, 2017 at 10:50:43PM -0500, Gustavo A. R. Silva wrote:
> >
> > Quoting Herbert Xu <herbert@gondor.apana.org.au>:
> >
> > >On Mon, Oct 23, 2017 at 01:18:57PM -0500, Gustavo A. R. Silva wrote:
> > >>Use BUG_ON instead of if condition followed by BUG.
> > >>
> > >>This issue was detected with the help of Coccinelle.
> > >>
> > >>Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> > >
> > >I think this patch is terrible. Why on earth is Coccinelle even
> > >warning about this?
> > >
> > >If anything we should be converting these constructs to not use
> > >BUG.
> > >
> >
> > Yeah, and under this assumption the original code is even worse.
>
> No your patch makes it worse. The original construct makes it
> clear that the conditional is real code and not just some debugging
> aid.
>
> With your patch, real code is now inside BUG_ON.
fwiw I had the same argument earlier:
https://lkml.org/lkml/2017/10/9/1139
next prev parent reply other threads:[~2017-10-24 4:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 18:18 [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG Gustavo A. R. Silva
2017-10-24 3:25 ` Herbert Xu
2017-10-24 3:50 ` Gustavo A. R. Silva
2017-10-24 3:53 ` Herbert Xu
2017-10-24 3:57 ` Gustavo A. R. Silva
2017-10-24 4:01 ` Alexei Starovoitov [this message]
2017-10-24 4:30 ` Herbert Xu
2017-10-24 8:48 ` David Miller
2017-10-25 4:05 ` Herbert Xu
2017-10-25 4:22 ` David Miller
2017-10-25 7:28 ` Steffen Klassert
2017-10-25 16:43 ` Gustavo A. R. Silva
2017-10-26 0:38 ` Gustavo A. R. Silva
2017-10-26 6:36 ` Herbert Xu
2017-10-26 10:47 ` Gustavo A. R. Silva
2017-10-26 11:31 ` [PATCH v2] " Gustavo A. R. Silva
2017-10-27 10:46 ` Steffen Klassert
2017-10-27 20:56 ` Gustavo A. R. Silva
2017-10-24 8:47 ` [PATCH] " David Miller
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=20171024040144.bf2cvq7p6zwg2e5k@ast-mbp \
--to=alexei.starovoitov@gmail.com \
--cc=davem@davemloft.net \
--cc=garsilva@embeddedor.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.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