libnvdimm, namespace: remove redundant initialization of 'nd_mapping'
authorColin Ian King <colin.king@canonical.com>
Tue, 30 Jan 2018 17:47:07 +0000 (17:47 +0000)
committerRoss Zwisler <ross.zwisler@linux.intel.com>
Sat, 3 Feb 2018 07:23:01 +0000 (00:23 -0700)
Pointer nd_mapping is being initialized to a value that is never read,
instead it is being updated to a new value in all the cases where it
is being read afterwards, hence the initialization is redundant and
can be removed.

Cleans up clang warning:
drivers/nvdimm/namespace_devs.c:2411:21: warning: Value stored to
'nd_mapping' during its initialization is never rea

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
drivers/nvdimm/namespace_devs.c

index bb3ba8cf24d4503801f3534f01a0e1f86cb7a641..658ada497be0a43f0a9df0d4a71aeaaa8df13bdb 100644 (file)
@@ -2408,7 +2408,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
 
 static struct device **create_namespaces(struct nd_region *nd_region)
 {
-       struct nd_mapping *nd_mapping = &nd_region->mapping[0];
+       struct nd_mapping *nd_mapping;
        struct device **devs;
        int i;