Skip to contentSkip to conversation

dm table: Constify static struct blk_ksm_ll_ops

PATCH New Rikard Falkeborn 1 participant 1 message May 26, 2021 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm table: Constify static struct blk_ksm_ll_ops

The only usage of dm_ksm_ll_ops is to make a copy of it to the ksm_ll_ops field in the blk_keyslot_manager struct. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/md/dm-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-table.c +1 -1
index ee47a332b462..7e88e5e06922 100644
@@ -1244,7 +1244,7 @@ static int dm_keyslot_evict(struct blk_keyslot_manager *ksm,
 	return args.err;
 }
 
-static struct blk_ksm_ll_ops dm_ksm_ll_ops = {
+static const struct blk_ksm_ll_ops dm_ksm_ll_ops = {
 	.keyslot_evict = dm_keyslot_evict,
 };
 
Signature · 1 line
2.31.1