Skip to contentSkip to conversation

dm: make static read-only array table const

PATCH New Colin Ian King 1 participant 1 message Jan 23, 2022

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

PATCH 1/1 dm: make static read-only array table const

The static array table as read-only so it make sense to make it const. Add in the int type to clean up checkpatch warning.

---
 drivers/md/dm-cache-policy-smq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/dm-cache-policy-smq.c +3 -1
index b61aac00ff40..19eac5d980a8 100644
@@ -1026,7 +1026,9 @@ static unsigned default_promote_level(struct smq_policy *mq)
 	 * This scheme reminds me of a graph of entropy vs probability of a
 	 * binary variable.
 	 */
-	static unsigned table[] = {1, 1, 1, 2, 4, 6, 7, 8, 7, 6, 4, 4, 3, 3, 2, 2, 1};
+	static const unsigned int table[] = {
+		1, 1, 1, 2, 4, 6, 7, 8, 7, 6, 4, 4, 3, 3, 2, 2, 1
+	};
 
 	unsigned hits = mq->cache_stats.hits;
 	unsigned misses = mq->cache_stats.misses;
Signature · 1 line
2.33.1