[2/5] libnvdimm, namespace: remove special handling when count == 0
diff mbox series

Message ID 20190128003018.4087-2-richardw.yang@linux.intel.com
State New
Headers show
Series
  • [1/5] libnvdimm, namespace: release labels properly on error
Related show

Commit Message

Wei Yang Jan. 28, 2019, 12:30 a.m. UTC
This is reasonable to continue directly when count == 0, while this case
could be merged in following for loop.

  count == 0, j == 0 => j >= count, loop continues.

This patch just removes the special handling to make the code look more
neat.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 drivers/nvdimm/namespace_devs.c | 2 --
 1 file changed, 2 deletions(-)

Patch
diff mbox series

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 234c0c79726a..0d64c4b38a56 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -2485,8 +2485,6 @@  static int init_active_labels(struct nd_region *nd_region)
 
 		count = nd_label_active_count(ndd);
 		dev_dbg(ndd->dev, "count: %d\n", count);
-		if (!count)
-			continue;
 		for (j = 0; j < count; j++) {
 			struct nd_namespace_label *label;