Re: [PATCH] net: xfrm_user: use BUG_ON instead of if condition followed by BUG
From: Herbert Xu
Date: Tue Oct 24 2017 - 00:31:46 EST
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@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt