From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhong jiang 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 Message-ID: <5B9B435C.4020300@huawei.com> References: <1536671593-14746-1-git-send-email-zhongjiang@huawei.com> <20180913.104254.1048729520825977993.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: , , , To: David Miller Return-path: In-Reply-To: <20180913.104254.1048729520825977993.davem@davemloft.net> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 2018/9/14 1:42, David Miller wrote: > From: zhong jiang > 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 > 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