Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933517AbbDIUNw (ORCPT ); Thu, 9 Apr 2015 16:13:52 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:22238 "EHLO mailrelay112.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933253AbbDIUNu (ORCPT ); Thu, 9 Apr 2015 16:13:50 -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=wjtdIHMbXVM_9FIFG-cA:9 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C5BwCN3CZV/6VYsltcgwiBLrJrBQEBAQEBAQUBe5gxgUhNAQEBAQEBfoR8I4EaN4guAc5hLIYQiTJlHYQXBZsMgR2KOYIHhwUigUVugT48MYECgUEBAQE From: Fabian Frederick To: linux-kernel@vger.kernel.org Cc: "J. Bruce Fields" , Julia Lawall , Fabian Frederick , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr Subject: [PATCH 1/1 linux-next] scripts/coccinelle/misc/bugon.cocci: update bug_on conversion warning Date: Thu, 9 Apr 2015 22:13:42 +0200 Message-Id: <1428610422-25075-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: 1208 Lines: 31 if()/BUG conversion to BUG_ON must be avoided when there's side effect in condition. The reason being BUG_ON won't execute condition when CONFIG_BUG is not defined. Inspired-by: J. Bruce Fields Suggested-by: Julia Lawall Signed-off-by: Fabian Frederick --- 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..0d18022 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 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/