Skip to contentSkip to conversation

dm thin: make const array descs static

PATCH New Colin Ian King 1 participant 1 message Oct 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm thin: make const array descs static

Don't populate the read-only const array ramp_base on the stack but instead make it static. Add in a const to clean up checkpatch warning too since the data and the pointer are const. Also makes the object code a little smaller.

---
 drivers/md/dm-thin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-thin.c +1 -1
index e76c96c760a9..d228177fdf35 100644
@@ -293,7 +293,7 @@ static enum pool_mode get_pool_mode(struct pool *pool)
 
 static void notify_of_pool_mode_change(struct pool *pool)
 {
-	const char *descs[] = {
+	static const char * const descs[] = {
 		"write",
 		"out-of-data-space",
 		"read-only",
Signature · 1 line
2.37.3