From patchwork Mon Nov 6 23:16:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 10044655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D4702604D3 for ; Mon, 6 Nov 2017 23:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6E742A0A0 for ; Mon, 6 Nov 2017 23:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBF5A2A0A4; Mon, 6 Nov 2017 23:18:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C9CF2A0A7 for ; Mon, 6 Nov 2017 23:18:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A2E7621C913AC; Mon, 6 Nov 2017 15:14:33 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=vishal.l.verma@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8FEC202E5E52 for ; Mon, 6 Nov 2017 15:14:32 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2017 15:18:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.44,355,1505804400"; d="scan'208"; a="1240542291" Received: from omniknight.lm.intel.com ([10.232.112.27]) by fmsmga002.fm.intel.com with ESMTP; 06 Nov 2017 15:18:31 -0800 From: Vishal Verma To: Subject: [ndctl PATCH 3/3] ndctl, inject-error: remove unreachable code Date: Mon, 6 Nov 2017 16:16:10 -0700 Message-Id: <20171106231610.8271-3-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171106231610.8271-1-vishal.l.verma@intel.com> References: <20171106231610.8271-1-vishal.l.verma@intel.com> X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP The iteration helper ndctl_namespace_bb_foreach ensures bb cannot be NULL in the loop, so an explicit check for it is not necessary. Remove it. Cc: Dan Williams Signed-off-by: Vishal Verma --- ndctl/inject-error.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/ndctl/inject-error.c b/ndctl/inject-error.c index 4c45902..a05f813 100644 --- a/ndctl/inject-error.c +++ b/ndctl/inject-error.c @@ -250,9 +250,6 @@ static int injection_status(struct ndctl_namespace *ndns) } ndctl_namespace_bb_foreach(ndns, bb) { - if (!bb) - break; - block = ndctl_bb_get_block(bb); count = ndctl_bb_get_count(bb); jbb = util_badblock_rec_to_json(block, count, ictx.flags);