projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c357342
)
dm cache policy smq: make static read-only array table const
author
Colin Ian King
<colin.i.king@gmail.com>
Sun, 23 Jan 2022 22:47:40 +0000
(22:47 +0000)
committer
Mike Snitzer
<snitzer@redhat.com>
Tue, 22 Feb 2022 15:35:53 +0000
(10:35 -0500)
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>
drivers/md/dm-cache-policy-smq.c
patch
|
blob
|
history
diff --git
a/drivers/md/dm-cache-policy-smq.c
b/drivers/md/dm-cache-policy-smq.c
index b61aac00ff40938c7b38f3ce67594baeb8cbf195..a3d281fc14c3ad1c604d42d59b521ff6386e53b0 100644
(file)
--- 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;