diff mbox

libnvdimm: remove used code in nd_pmem_forget_poison_check()

Message ID 150938744600.18848.5814902918600734916.stgit@djiang5-desk3.ch.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Jiang Oct. 30, 2017, 6:17 p.m. UTC
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 <dan.carpenter@oracle.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/nvdimm/bus.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

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;