Skip to contentSkip to conversation

mfd: arizona: make array mclk_name static, shrinks object size

PATCH Applied Colin King 3 participants 3 messages Sep 4, 2018 – Sep 11, 2018

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 mfd: arizona: make array mclk_name static, shrinks object size

From: Colin Ian King <[email protected]>

Don't populate the array mclk_name on the stack but instead make it static. Makes the object code smaller by 23 bytes:

Before:
text data bss dec hex filename
38050 11604 64 49718 c236 linux/drivers/mfd/arizona-core.o

After:
text data bss dec hex filename
38027 11604 64 49695 c21f linux/drivers/mfd/arizona-core.o

(gcc version 8.2.0 x86_64)

---
 drivers/mfd/arizona-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/arizona-core.c +1 -1
index 5f1e37d23943..918d81a00b37 100644
@@ -990,7 +990,7 @@ static const struct mfd_cell wm8998_devs[] = {
 
 int arizona_dev_init(struct arizona *arizona)
 {
-	const char * const mclk_name[] = { "mclk1", "mclk2" };
+	static const char * const mclk_name[] = { "mclk1", "mclk2" };
 	struct device *dev = arizona->dev;
 	const char *type_name = NULL;
 	unsigned int reg, val;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

Don't populate the array mclk_name on the stack but instead make it static. Makes the object code smaller by 23 bytes:

Before:
text data bss dec hex filename
38050 11604 64 49718 c236 linux/drivers/mfd/arizona-core.o

Quoted 8 lines

After:
text data bss dec hex filename
38027 11604 64 49695 c21f linux/drivers/mfd/arizona-core.o

(gcc version 8.2.0 x86_64)

---

Thanks,
Charles

Applied
#2 lore raw
In reply to Colin King
Quoted 13 lines · Colin King

From: Colin Ian King <[email protected]>

Don't populate the array mclk_name on the stack but instead make it static. Makes the object code smaller by 23 bytes:

Before:
text data bss dec hex filename
38050 11604 64 49718 c236 linux/drivers/mfd/arizona-core.o

After:
text data bss dec hex filename
38027 11604 64 49695 c21f linux/drivers/mfd/arizona-core.o

Quoted 6 lines

(gcc version 8.2.0 x86_64)

---
 drivers/mfd/arizona-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog