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:07 +0100
commitcd87e2ee73991b535e3f9a68d2a3686ad50948a7 (patch)
tree0a22e50afa915735a1a0d075e4f9367868662c51
parent84403a8842860d3256c60c1ae6a7ad30e071ffaf (diff)
nvdimm: Remove empty if statement (bsc#1111921, bsc#1113408,
-rw-r--r--patches.fixes/nvdimm-remove-empty-if-statement.patch38
-rw-r--r--series.conf1
2 files changed, 39 insertions, 0 deletions
diff --git a/patches.fixes/nvdimm-remove-empty-if-statement.patch b/patches.fixes/nvdimm-remove-empty-if-statement.patch
new file mode 100644
index 0000000000..617a18440d
--- /dev/null
+++ b/patches.fixes/nvdimm-remove-empty-if-statement.patch
@@ -0,0 +1,38 @@
+From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
+Date: Wed, 10 Oct 2018 16:39:06 -0700
+Subject: nvdimm: Remove empty if statement
+Git-commit: 19418b024427ec60ba6084addf691a8d93670398
+Patch-mainline: v4.20-rc1
+References: bsc#1111921, bsc#1113408, FATE#326765
+
+This patch removes an empty statement from an if expression and promotes
+the else statement to the if expression with the expression logic reversed.
+
+I feel this is more readable as the empty statement can lead to issues if
+any additional logic was ever added.
+
+Reviewed-by: Toshi Kani <toshi.kani@hpe.com>
+Signed-off-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 | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
+index bb813b8e8ace..43bad0d5bdb6 100644
+--- a/drivers/nvdimm/label.c
++++ b/drivers/nvdimm/label.c
+@@ -261,9 +261,8 @@ int nd_label_validate(struct nvdimm_drvdata *ndd)
+ void nd_label_copy(struct nvdimm_drvdata *ndd, struct nd_namespace_index *dst,
+ struct nd_namespace_index *src)
+ {
+- if (dst && src)
+- /* pass */;
+- else
++ /* just exit if either destination or source is NULL */
++ if (!dst || !src)
+ return;
+
+ memcpy(dst, src, sizeof_namespace_index(ndd));
+
diff --git a/series.conf b/series.conf
index 0cd4fdd881..8909d4910a 100644
--- a/series.conf
+++ b/series.conf
@@ -18055,6 +18055,7 @@
patches.fixes/libnvdimm-dimm-maximize-label-transfer-size.patch
patches.fixes/nvdimm-sanity-check-labeloff.patch
patches.fixes/nvdimm-clarify-comment-in-sizeof_namespace_index.patch
+ patches.fixes/nvdimm-remove-empty-if-statement.patch
# davem/net
patches.fixes/udp-Unbreak-modules-that-rely-on-external-__skb_recv.patch