libnvdimm/label: Add a helper for nlabel validation
authorDan Williams <dan.j.williams@intel.com>
Thu, 9 Sep 2021 05:11:42 +0000 (22:11 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 21 Sep 2021 20:44:55 +0000 (13:44 -0700)
commit8172db92527c936c638b52274fbd06a0a624a56b
tree9cc931dfba36b5cb0350afcc7ae08a1a83fe4b28
parentd1c6e08e7503649e4a4f3f9e700e2c05300b6379
libnvdimm/label: Add a helper for nlabel validation

In the CXL namespace label there is no need for nlabel since that is
inferred from the region. Add a helper that moves nsl_get_label() behind
a helper that validates the number of labels relative to the region.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/163116430293.2460985.12693942353621355232.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/namespace_devs.c
drivers/nvdimm/nd.h