Commit d37806dc authored by Fabian Frederick's avatar Fabian Frederick Committed by Dan Williams

libnvdimm: remove else after return in nsio_rw_bytes()

else after return is not needed.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
[djbw: removed some now unnecessary newlines]
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 238b323a
...@@ -242,28 +242,25 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, ...@@ -242,28 +242,25 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align)))
return -EIO; return -EIO;
return memcpy_from_pmem(buf, nsio->addr + offset, size); return memcpy_from_pmem(buf, nsio->addr + offset, size);
} else { }
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) { if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) { if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
long cleared; long cleared;
cleared = nvdimm_clear_poison(&ndns->dev, cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
offset, size);
if (cleared != size) { if (cleared != size) {
size = cleared; size = cleared;
rc = -EIO; rc = -EIO;
} }
badblocks_clear(&nsio->bb, sector, badblocks_clear(&nsio->bb, sector, cleared >> 9);
cleared >> 9);
} else } else
rc = -EIO; rc = -EIO;
} }
memcpy_to_pmem(nsio->addr + offset, buf, size); memcpy_to_pmem(nsio->addr + offset, buf, size);
nvdimm_flush(to_nd_region(ndns->dev.parent)); nvdimm_flush(to_nd_region(ndns->dev.parent));
}
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment