Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755018AbaGHWVt (ORCPT ); Tue, 8 Jul 2014 18:21:49 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:48157 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbaGHWVs (ORCPT ); Tue, 8 Jul 2014 18:21:48 -0400 Date: Wed, 9 Jul 2014 03:51:41 +0530 From: Himangi Saraogi To: Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH] Btrfs: use BUG_ON Message-ID: <20140708222141.GA11854@himangi-Dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); // Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6104676..63e746e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2623,8 +2623,8 @@ again: found_key.offset); if (ret == -ENOSPC) failed++; - else if (ret) - BUG(); + else + BUG_ON(ret); } if (found_key.offset == 0) -- 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/