Messages in this thread | ![/](/images/icornerl.gif) | | Date | Tue, 24 Oct 2017 12:30:51 +0800 | From | Herbert Xu <> | Subject | Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG |
| |
On Mon, Oct 23, 2017 at 09:01:46PM -0700, Alexei Starovoitov wrote: > > fwiw I had the same argument earlier: > https://lkml.org/lkml/2017/10/9/1139
Fair point on eliminating a branch. But I'd prefer something like
bool cond;
cond = code_that_does_something(); BUG_ON(cond);
rather than just
BUG_ON(code_that_does_something());
But maybe it's just me.
Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
| ![\](/images/icornerr.gif) |