diff options
author | Colin Ian King <[email protected]> | 2019-11-30 17:58:04 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-12-01 12:59:10 -0800 |
commit | 26083eb6b15448e7ec5182e33f9b1ba7ebce3a62 (patch) | |
tree | 9b192596ab12a3a2f3d2707db9acbac531d16b9d | |
parent | 3c1c24d91ffd536de0a64688a9df7f49e58fadbc (diff) |
mm/shmem.c: make array 'values' static const, makes object smaller
Don't populate the array 'values' on the stack but instead make it static
const. Makes the object code smaller by 111 bytes.
Before:
text data bss dec hex filename
108612 11169 512 120293 1d5e5 mm/shmem.o
After:
text data bss dec hex filename
108437 11233 512 120182 1d576 mm/shmem.o
(gcc version 9.2.1, amd64)
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/shmem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 60de3d9e26a7..6e4e742db5c2 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3932,7 +3932,7 @@ out2: static ssize_t shmem_enabled_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - int values[] = { + static const int values[] = { SHMEM_HUGE_ALWAYS, SHMEM_HUGE_WITHIN_SIZE, SHMEM_HUGE_ADVISE, |