summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2016-12-04 10:45:13 -0800
committerDan Williams <dan.j.williams@intel.com>2016-12-04 10:45:13 -0800
commitd37806dc37b42b05515849b0444f09f493cb4cba (patch)
tree32f2e04fd0c364c913e066445265ef1f5ca5a004 /drivers/nvdimm
parent238b323a681dd4a5ea0c651fdf4e6ee91a09a9ba (diff)
downloadtalos-op-linux-d37806dc37b42b05515849b0444f09f493cb4cba.tar.gz
talos-op-linux-d37806dc37b42b05515849b0444f09f493cb4cba.zip
libnvdimm: remove else after return in nsio_rw_bytes()
else after return is not needed. Signed-off-by: Fabian Frederick <fabf@skynet.be> [djbw: removed some now unnecessary newlines] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/claim.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 4638b9ea5229..3376da1fb263 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -242,29 +242,26 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns,
if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align)))
return -EIO;
return memcpy_from_pmem(buf, nsio->addr + offset, size);
- } else {
-
- if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
- if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
- long cleared;
-
- cleared = nvdimm_clear_poison(&ndns->dev,
- offset, size);
- if (cleared != size) {
- size = cleared;
- rc = -EIO;
- }
-
- badblocks_clear(&nsio->bb, sector,
- cleared >> 9);
- } else
+ }
+
+ if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
+ if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
+ long cleared;
+
+ cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
+ if (cleared != size) {
+ size = cleared;
rc = -EIO;
- }
+ }
- memcpy_to_pmem(nsio->addr + offset, buf, size);
- nvdimm_flush(to_nd_region(ndns->dev.parent));
+ badblocks_clear(&nsio->bb, sector, cleared >> 9);
+ } else
+ rc = -EIO;
}
+ memcpy_to_pmem(nsio->addr + offset, buf, size);
+ nvdimm_flush(to_nd_region(ndns->dev.parent));
+
return rc;
}
OpenPOWER on IntegriCloud