[PATCH V2 1/3 libnvdimm-pending] libnvdimm: remove else after return in nsio_rw_bytes()

From: Fabian Frederick
Date: Sat Dec 03 2016 - 13:53:44 EST


else after return is not needed.

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
V2: -applied on top of libnvdimm-pending

drivers/nvdimm/claim.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 4638b9e..75c36c3 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -242,29 +242,28 @@ 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;
}

--
2.7.4