projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fbd8d1
)
mtd: mtdswap: make array 'name' static const, shrinks object size
author
Colin Ian King
<colin.king@canonical.com>
Tue, 28 Nov 2017 18:59:46 +0000
(18:59 +0000)
committer
Boris Brezillon
<boris.brezillon@free-electrons.com>
Sat, 16 Dec 2017 20:30:08 +0000
(21:30 +0100)
Don't populate the read-only array 'name' on the stack but instead
make it static and constify it. Makes the object code smaller by 35
bytes:
Before:
text data bss dec hex filename
26304 4444 352 31100 797c drivers/mtd/mtdswap.o
After:
text data bss dec hex filename
26205 4508 352 31065 7959 drivers/mtd/mtdswap.o
(gcc version 7.2.0 x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/mtdswap.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/mtdswap.c
b/drivers/mtd/mtdswap.c
index f07492c6f4b2bd76227a7e4251560ca3a424ec47..7eb0e1f4f9803ad3f9f00b296eb21388447f341e 100644
(file)
--- a/
drivers/mtd/mtdswap.c
+++ b/
drivers/mtd/mtdswap.c
@@
-1223,8
+1223,9
@@
static int mtdswap_show(struct seq_file *s, void *data)
unsigned int max[MTDSWAP_TREE_CNT];
unsigned int i, cw = 0, cwp = 0, cwecount = 0, bb_cnt, mapped, pages;
uint64_t use_size;
- char *name[] = {"clean", "used", "low", "high", "dirty", "bitflip",
- "failing"};
+ static const char * const name[] = {
+ "clean", "used", "low", "high", "dirty", "bitflip", "failing"
+ };
mutex_lock(&d->mbd_dev->lock);