aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-cache-policy-smq.c
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2022-01-23 22:47:40 +0000
committerMike Snitzer <snitzer@redhat.com>2022-02-22 10:35:53 -0500
commit302f035141d3d4faee36f8543d34a32fb36a886d (patch)
treec1c84123905bb5834ee4100abe074fd92ea6654e /drivers/md/dm-cache-policy-smq.c
parentdm delay: use dm_submit_bio_remap (diff)
downloadlinux-dev-302f035141d3d4faee36f8543d34a32fb36a886d.tar.xz
linux-dev-302f035141d3d4faee36f8543d34a32fb36a886d.zip
dm cache policy smq: make static read-only array table const
The 'table' static array is read-only so it make sense to make it const. Add in the int type to clean up checkpatch warning. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-policy-smq.c')
-rw-r--r--drivers/md/dm-cache-policy-smq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c
index b61aac00ff40..a3d281fc14c3 100644
--- a/drivers/md/dm-cache-policy-smq.c
+++ b/drivers/md/dm-cache-policy-smq.c
@@ -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;