Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97052c1c authored by Dan Williams's avatar Dan Williams
Browse files

libnvdimm, label: Fix sparse warning



The kbuild robot reports:

drivers/nvdimm/label.c:500:32: warning: restricted __le32 degrades to integer

...read 'nslot' into a local u32.

Reported-by: default avatarkbuild test robot <lkp@intel.com>
Acked-by: default avatarAlexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 7d47aad4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -424,6 +424,7 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)
	struct nd_namespace_index *nsindex;
	unsigned int i;
	int rc = 0;
	u32 nslot;

	if (ndd->data)
		return 0;
@@ -495,9 +496,10 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)

	/* Determine starting offset for label data */
	offset = __le64_to_cpu(nsindex->labeloff);
	nslot = __le32_to_cpu(nsindex->nslot);

	/* Loop through the free list pulling in any active labels */
	for (i = 0; i < nsindex->nslot; i++, offset += ndd->nslabel_size) {
	for (i = 0; i < nslot; i++, offset += ndd->nslabel_size) {
		size_t label_read_size;

		/* zero out the unused labels */