Skip to contentSkip to conversation

nvdimm/namespace: drop nested variable in create_namespace_pmem()

PATCH In review Andy Shevchenko 2 participants 3 messages Jun 7, 2022 – Jul 14, 2022 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvdimm/namespace: drop nested variable in create_namespace_pmem()

Kernel build bot reported:

namespace_devs.c:1991:10: warning: Local variable 'uuid' shadows outer variable [shadowVariable]

Refactor create_namespace_pmem() by dropping a nested version of the same variable.

Fixes d1c6e08e7503 ("libnvdimm/labels: Add uuid helpers")
---
 drivers/nvdimm/namespace_devs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/nvdimm/namespace_devs.c +0 -2
index 0f863fda56e6..dfade66bab73 100644
@@ -1704,8 +1704,6 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
 	res->flags = IORESOURCE_MEM;
 
 	for (i = 0; i < nd_region->ndr_mappings; i++) {
-		uuid_t uuid;
-
 		nsl_get_uuid(ndd, nd_label, &uuid);
 		if (has_uuid_at_pos(nd_region, &uuid, cookie, i))
 			continue;
Signature · 1 line
2.35.1
#1 lore raw
Quoted 6 lines · Andy Shevchenko

Kernel build bot reported:

namespace_devs.c:1991:10: warning: Local variable 'uuid' shadows outer variable [shadowVariable]

Refactor create_namespace_pmem() by dropping a nested version of the same variable.

Any comments on this and other two patches?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

Kernel build bot reported:

namespace_devs.c:1991:10: warning: Local variable 'uuid' shadows outer variable [shadowVariable]

Refactor create_namespace_pmem() by dropping a nested version of the same variable.

Applied for 5.19-rc.

Thanks!