Skip to contentSkip to conversation

dm table: Fix W=1 build warning when mempool_needs_integrity is unused

PATCH In review Andy Shevchenko 2 participants 5 messages Apr 7, 2025 – Apr 15, 2025 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm table: Fix W=1 build warning when mempool_needs_integrity is unused

The mempool_needs_integrity is unused. This, in particular, prevents kernel builds with Clang, make W=1 and CONFIG_WERROR=y:

drivers/md/dm-table.c:1052:7: error: variable 'mempool_needs_integrity' set but not used [-Werror,-Wunused-but-set-variable]
1052 | bool mempool_needs_integrity = t->integrity_supported;
| ^

Fix this by removing the leftover.

Fixes 105ca2a2c2ff ("block: split struct bio_integrity_payload")
---
 drivers/md/dm-table.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/md/dm-table.c +0 -3
index 35100a435c88..53759dbbe9d6 100644
@@ -1049,7 +1049,6 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *
 	unsigned int min_pool_size = 0, pool_size;
 	struct dm_md_mempools *pools;
 	unsigned int bioset_flags = 0;
-	bool mempool_needs_integrity = t->integrity_supported;
 
 	if (unlikely(type == DM_TYPE_NONE)) {
 		DMERR("no table type is set, can't allocate mempools");
@@ -1074,8 +1073,6 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *
 
 		per_io_data_size = max(per_io_data_size, ti->per_io_data_size);
 		min_pool_size = max(min_pool_size, ti->num_flush_bios);
-
-		mempool_needs_integrity |= ti->mempool_needs_integrity;
 	}
 	pool_size = max(dm_get_reserved_bio_based_ios(), min_pool_size);
 	front_pad = roundup(per_io_data_size,
Signature · 1 line
2.47.2
#1 lore raw
Quoted 8 lines · Andy Shevchenko

The mempool_needs_integrity is unused. This, in particular, prevents kernel builds with Clang, make W=1 and CONFIG_WERROR=y:

drivers/md/dm-table.c:1052:7: error: variable 'mempool_needs_integrity' set but not used [-Werror,-Wunused-but-set-variable]
1052 | bool mempool_needs_integrity = t->integrity_supported;
| ^

Fix this by removing the leftover.

This issue is still present in v6.15-rc1.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 11 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

The mempool_needs_integrity is unused. This, in particular, prevents kernel builds with Clang, make W=1 and CONFIG_WERROR=y:

drivers/md/dm-table.c:1052:7: error: variable 'mempool_needs_integrity' set but not used [-Werror,-Wunused-but-set-variable]
1052 | bool mempool_needs_integrity = t->integrity_supported;
| ^

Fix this by removing the leftover.

This issue is still present in v6.15-rc1.

I meant v6.15-rc2, of course.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#3 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Andy Shevchenko

The mempool_needs_integrity is unused. This, in particular, prevents kernel builds with Clang, make W=1 and CONFIG_WERROR=y:

drivers/md/dm-table.c:1052:7: error: variable 'mempool_needs_integrity' set but not used [-Werror,-Wunused-but-set-variable]
1052 | bool mempool_needs_integrity = t->integrity_supported;
| ^

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

Fix this by removing the leftover.

This issue is still present in v6.15-rc1.

I meant v6.15-rc2, of course.

Signature · 2 lines
With Best Regards,
Andy Shevchenko

I will send it to Linus (maybe with other changes) before 6.15 comes out.

Mikulas

#4 lore raw
Quoted 10 lines · Mikulas Patocka
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Andy Shevchenko

The mempool_needs_integrity is unused. This, in particular, prevents kernel builds with Clang, make W=1 and CONFIG_WERROR=y:

drivers/md/dm-table.c:1052:7: error: variable 'mempool_needs_integrity' set but not used [-Werror,-Wunused-but-set-variable]
1052 | bool mempool_needs_integrity = t->integrity_supported;
| ^

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Fix this by removing the leftover.

This issue is still present in v6.15-rc1.

I meant v6.15-rc2, of course.

I will send it to Linus (maybe with other changes) before 6.15 comes out.

Thank you!

Signature · 2 lines
With Best Regards,
Andy Shevchenko