From patchwork Mon Oct 19 11:37:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 7435201 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78CE6BEEA4 for ; Mon, 19 Oct 2015 11:44:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B89BE20693 for ; Mon, 19 Oct 2015 11:44:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB4C720691 for ; Mon, 19 Oct 2015 11:44:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751151AbbJSLon (ORCPT ); Mon, 19 Oct 2015 07:44:43 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:32912 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750699AbbJSLon (ORCPT ); Mon, 19 Oct 2015 07:44:43 -0400 Received: by pabrc13 with SMTP id rc13so189426316pab.0 for ; Mon, 19 Oct 2015 04:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J3fyIkWyLA/H1uKNZr3i3huFJlNI+hT1cmiEv/ptYoM=; b=tDxzaaj76ubzw7uCJhzC7/jPGTDl+e/Lb/gwciKLeEfOCQXPLoy7K+wVFI3FOn2Dh0 lM7wORiaq6snnI3g8B5amYAKCr4B/5HaNy0TvtDUJci/4IkvwTdSauIoOhqI5jt1o5US fNUy/MYHZNITLGsMSAJ7mcmpGXKTID97iSd3S86BqZqP8befbA+4T+j9YYg8EHFgi3Pu 5oBW8PLNh4Z02rY2VXOeYCRLCoYEo3Ni/hYjrImL9/NCd5GIjyzNXBUkWJgfm4gfuPpR cKwIazlEzQQDRkP+avTmdfqj/YAH20DiNKUo7c3CnHncQ1QTq8Jvh1qKTT+cDhGT+7Qe orlA== X-Received: by 10.68.92.99 with SMTP id cl3mr9057359pbb.60.1445255082515; Mon, 19 Oct 2015 04:44:42 -0700 (PDT) Received: from localhost ([128.199.137.77]) by smtp.gmail.com with ESMTPSA id po7sm35941058pbc.56.2015.10.19.04.44.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 04:44:42 -0700 (PDT) From: Eryu Guan To: linux-btrfs@vger.kernel.org Cc: Eryu Guan Subject: [PATCH 05/10] btrfs-progs: mute coverity warnings about deadcode Date: Mon, 19 Oct 2015 19:37:55 +0800 Message-Id: <1445254680-11102-6-git-send-email-guaneryu@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1445254680-11102-1-git-send-email-guaneryu@gmail.com> References: <1445254680-11102-1-git-send-email-guaneryu@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Coverity reports execution cannot reach this statements. So put WARN_ON in if-else conditions. Signed-off-by: Eryu Guan --- backref.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backref.c b/backref.c index 9a2efca..8f41f82 100644 --- a/backref.c +++ b/backref.c @@ -323,9 +323,9 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, eb = path->nodes[level]; while (!eb) { - WARN_ON(!level); if (!level) { ret = 1; + WARN_ON(1); goto out; } level--; @@ -1178,7 +1178,6 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, logical, logical - found_key->objectid, found_key->objectid, found_key->offset, flags, item_size); - WARN_ON(!flags_ret); if (flags_ret) { if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) *flags_ret = BTRFS_EXTENT_FLAG_TREE_BLOCK; @@ -1187,9 +1186,10 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, else BUG_ON(1); return 0; + } else { + WARN_ON(1); + return -EIO; } - - return -EIO; } /*