Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760939AbYBRURR (ORCPT ); Mon, 18 Feb 2008 15:17:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761276AbYBRUQd (ORCPT ); Mon, 18 Feb 2008 15:16:33 -0500 Received: from rgminet01.oracle.com ([148.87.113.118]:50502 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761265AbYBRUQa (ORCPT ); Mon, 18 Feb 2008 15:16:30 -0500 Date: Mon, 18 Feb 2008 12:14:53 -0800 From: Mark Fasheh To: Julia Lawall Cc: kurt.hackel@oracle.com, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 3/7] fs/ocfs2: Use BUG_ON Message-ID: <20080218201453.GA22671@ca-server1.us.oracle.com> Reply-To: Mark Fasheh References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Oracle Corporation User-Agent: Mutt/1.5.16 (2007-06-11) X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 41 On Sun, Feb 17, 2008 at 06:55:49PM +0100, Julia Lawall wrote: > From: Julia Lawall > > if (...) BUG(); should be replaced with BUG_ON(...) when the test has no > side-effects to allow a definition of BUG_ON that drops the code completely. > > The semantic patch that makes this change is as follows: > (http://www.emn.fr/x-info/coccinelle/) > > // > @ disable unlikely @ expression E,f; @@ > > ( > if (<... f(...) ...>) { BUG(); } > | > - if (unlikely(E)) { BUG(); } > + BUG_ON(E); > ) > > @@ expression E,f; @@ > > ( > if (<... f(...) ...>) { BUG(); } > | > - if (E) { BUG(); } > + BUG_ON(E); > ) > // > > Signed-off-by: Julia Lawall Acked-by: Mark Fasheh -- Mark Fasheh Principal Software Developer, Oracle mark.fasheh@oracle.com -- 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/