From patchwork Tue Aug 2 10:35:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1028802 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p72AadcD023155 for ; Tue, 2 Aug 2011 10:37:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378Ab1HBKgk (ORCPT ); Tue, 2 Aug 2011 06:36:40 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:59150 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753272Ab1HBKfS (ORCPT ); Tue, 2 Aug 2011 06:35:18 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id B554F19BC5E; Tue, 2 Aug 2011 12:35:17 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24226-03; Tue, 2 Aug 2011 12:35:10 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 2DEC919BC4B; Tue, 2 Aug 2011 12:35:05 +0200 (CEST) From: Julia Lawall To: Chris Mason , trivial@kernel.org Cc: kernel-janitors@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/11] fs/btrfs/volumes.c: trivial: use BUG_ON Date: Tue, 2 Aug 2011 12:35:01 +0200 Message-Id: <1312281304-11847-9-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1312281304-11847-1-git-send-email-julia@diku.dk> References: <1312281304-11847-1-git-send-email-julia@diku.dk> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Aug 2011 10:37:09 +0000 (UTC) From: Julia Lawall Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // Signed-off-by: Julia Lawall --- fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 19450bc..275be0f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1983,8 +1983,8 @@ again: found_key.offset); if (ret == -ENOSPC) failed++; - else if (ret) - BUG(); + else + BUG_ON(ret); } if (found_key.offset == 0)