Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 10:48:30 +0100
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-31 10:49:27 +0100
commitb77962d53b18883f895d39d7e4588884e88865ac (patch)
tree392957a6cf4215a39048aefc261b970a343f4370
parent16659ee10812bf91438261f78009337f4c3f3b80 (diff)
libnvdimm, label: Fix sparse warning (bsc#1111921, bsc#1113408,
-rw-r--r--patches.fixes/libnvdimm-label-fix-sparse-warning.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.fixes/libnvdimm-label-fix-sparse-warning.patch b/patches.fixes/libnvdimm-label-fix-sparse-warning.patch
new file mode 100644
index 0000000000..f8f16df3df
--- /dev/null
+++ b/patches.fixes/libnvdimm-label-fix-sparse-warning.patch
@@ -0,0 +1,46 @@
+From: Dan Williams <dan.j.williams@intel.com>
+Date: Thu, 11 Oct 2018 18:25:20 -0700
+Subject: libnvdimm, label: Fix sparse warning
+Git-commit: 97052c1c31d5bcf08823ce1ea272447edd2d52de
+Patch-mainline: v4.20-rc1
+References: bsc#1111921, bsc#1113408, FATE#326765
+
+The kbuild robot reports:
+
+drivers/nvdimm/label.c:500:32: warning: restricted __le32 degrades to integer
+
+...read 'nslot' into a local u32.
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Acked-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
+Signed-off-by: Dan Williams <dan.j.williams@intel.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/nvdimm/label.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
+index 7f03d117824f..750dbaa6ce82 100644
+--- a/drivers/nvdimm/label.c
++++ b/drivers/nvdimm/label.c
+@@ -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 */
+
diff --git a/series.conf b/series.conf
index cd73524e8b..7ce6306076 100644
--- a/series.conf
+++ b/series.conf
@@ -18058,6 +18058,7 @@
patches.fixes/nvdimm-remove-empty-if-statement.patch
patches.fixes/nvdimm-split-label-init-out-from-the-logic-for-getting-config-data.patch
patches.fixes/nvdimm-use-namespace-index-data-to-reduce-number-of-label-reads-needed.patch
+ patches.fixes/libnvdimm-label-fix-sparse-warning.patch
# davem/net
patches.fixes/udp-Unbreak-modules-that-rely-on-external-__skb_recv.patch