Skip to content

Commit

Permalink
dm cache policy smq: make static read-only array table const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Mike Snitzer committed Feb 22, 2022
1 parent c357342 commit 302f035
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm-cache-policy-smq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 302f035

Please sign in to comment.