Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756211AbbDIU6R (ORCPT ); Thu, 9 Apr 2015 16:58:17 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:35213 "EHLO mailrelay112.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753378AbbDIU6O (ORCPT ); Thu, 9 Apr 2015 16:58:14 -0400 X-Belgacom-Dynamic: yes X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=U3bOsIs4jTLKnNjizNqmwgH4x/ZVWD6r1e7q5IgUJPc= c=1 sm=2 a=mJjC6ScEAAAA:8 a=05oQ047nAAAA:8 a=lF74xYaEqxubFOBp6SAA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C5BwD85iZV/6VYsltcgweBLrJrBQEBAQEBAQUBe5gxgUlNAQEBAQEBfoR8I4EaN4guAc58hhCJMmUdhBcFmwyBHYo5ggeHBSKBRW6BPjwxgQKBQQEBAQ From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: Andrew Morton , "J. Bruce Fields" , Julia Lawall , Fabian Frederick , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr Subject: [PATCH V2 linux-next] scripts/coccinelle/misc/bugon.cocci: update bug_on conversion warning Date: Thu, 9 Apr 2015 22:58:04 +0200 Message-Id: <1428613084-2861-1-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 34 if()/BUG conversion to BUG_ON must be avoided when there's side effect in condition. The reason being BUG_ON won't execute the condition when CONFIG_BUG is not defined. Inspired-by: J. Bruce Fields Suggested-by: Julia Lawall Acked-by: Julia Lawall Signed-off-by: Fabian Frederick --- V2: s/condition/the condition/ scripts/coccinelle/misc/bugon.cocci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coccinelle/misc/bugon.cocci b/scripts/coccinelle/misc/bugon.cocci index 3b7eec2..27c97f1 100644 --- a/scripts/coccinelle/misc/bugon.cocci +++ b/scripts/coccinelle/misc/bugon.cocci @@ -57,6 +57,6 @@ coccilib.org.print_todo(p[0], "WARNING use BUG_ON") p << r.p; @@ -msg="WARNING: Use BUG_ON" +msg="WARNING: Use BUG_ON instead of if condition followed by BUG.\nPlease make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)" coccilib.report.print_report(p[0], msg) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/