diff mbox series

[3/5] libnvdimm, label: return nd_label directly instead of calculating it again

Message ID 20190128003018.4087-3-richardw.yang@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/5] libnvdimm, namespace: release labels properly on error | expand

Commit Message

Wei Yang Jan. 28, 2019, 12:30 a.m. UTC
In nd_label_active(), we get nd_label from label area. While it is not
necessary to calculate it a second time.

This patch return nd_label directly.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 drivers/nvdimm/label.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index 750dbaa6ce82..63b7d40fe9d4 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -587,7 +587,7 @@  struct nd_namespace_label *nd_label_active(struct nvdimm_drvdata *ndd, int n)
 			continue;
 
 		if (n-- == 0)
-			return to_label(ndd, slot);
+			return nd_label;
 	}
 
 	return NULL;