From patchwork Mon Oct 30 18:17:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Jiang X-Patchwork-Id: 10033013 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 F0C5A60291 for ; Mon, 30 Oct 2017 18:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB6122837E for ; Mon, 30 Oct 2017 18:17:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF9BB2854F; Mon, 30 Oct 2017 18:17:29 +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 C57C12837E for ; Mon, 30 Oct 2017 18:17:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5D1A821F3B3EA; Mon, 30 Oct 2017 11:13:37 -0700 (PDT) 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.65; helo=mga03.intel.com; envelope-from=dave.jiang@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 3462721F3B3E5 for ; Mon, 30 Oct 2017 11:13:36 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2017 11:17:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,320,1505804400"; d="scan'208";a="166969341" Received: from djiang5-desk3.ch.intel.com ([143.182.137.38]) by orsmga005.jf.intel.com with ESMTP; 30 Oct 2017 11:17:26 -0700 Subject: [PATCH] libnvdimm: remove used code in nd_pmem_forget_poison_check() From: Dave Jiang To: dan.j.williams@intel.com Date: Mon, 30 Oct 2017 11:17:26 -0700 Message-ID: <150938744600.18848.5814902918600734916.stgit@djiang5-desk3.ch.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 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: , Cc: dan.carpenter@oracle.com, linux-nvdimm@lists.01.org Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Dan Carpenter reported: The patch 006358b35c73: "libnvdimm: add support for clear poison list and badblocks for device dax" from Apr 7, 2017, leads to the following static checker warning: drivers/nvdimm/bus.c:852 nd_pmem_forget_poison_check() warn: we tested 'nd_dax' before and it was 'false' Remove unused code. Reported-by: Dan Carpenter Signed-off-by: Dave Jiang --- drivers/nvdimm/bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index baf2839..c042174 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -849,13 +849,11 @@ static int nd_pmem_forget_poison_check(struct device *dev, void *data) start = clear_err->address; end = clear_err->address + clear_err->cleared - 1; - if (nd_btt || nd_pfn || nd_dax) { + if (nd_btt || nd_pfn) { if (nd_btt) ndns = nd_btt->ndns; else if (nd_pfn) ndns = nd_pfn->ndns; - else if (nd_dax) - ndns = nd_dax->nd_pfn.ndns; if (!ndns) return 0;