Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnvdimm, namespace: remove redundant initialization of 'nd_mapping'

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>

authored by

Colin Ian King and committed by
Ross Zwisler
59858d3d 23fbd7c7

+1 -1
+1 -1
drivers/nvdimm/namespace_devs.c
··· 2408 2408 2409 2409 static struct device **create_namespaces(struct nd_region *nd_region) 2410 2410 { 2411 - struct nd_mapping *nd_mapping = &nd_region->mapping[0]; 2411 + struct nd_mapping *nd_mapping; 2412 2412 struct device **devs; 2413 2413 int i; 2414 2414