lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv2] net: ipv4: Use BUG_ON directly instead of a if condition followed by BUG
From
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.

\
 
 \ /
  Last update: 2018-09-13 19:43    [W:0.045 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site