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 <[email protected]>
Signed-off-by: Dave Jiang <[email protected]>
---
 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;

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to