diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-08-30 04:32:25 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-08-30 09:31:49 -0400 |
commit | 6930125858c71a62a964437c360f188e96879438 (patch) | |
tree | 291dbf7e5b47a0d7b2ad81fe7659896a8a81840b | |
parent | 5783ec2e5c102a6a04d17e07bd9d008a464ed9bc (diff) |
hwmon: (asc7621) make several arrays static const
Don't populate the arrays on the stack, instead make them static.
Makes the object code smaller by over 950 bytes:
Before:
text data bss dec hex filename
26144 18768 352 45264 b0d0 drivers/hwmon/asc7621.o
After:
text data bss dec hex filename
25029 18928 352 44309 ad15 drivers/hwmon/asc7621.o
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/asc7621.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/asc7621.c b/drivers/hwmon/asc7621.c index c77644d45a02..4875e99b59c9 100644 --- a/drivers/hwmon/asc7621.c +++ b/drivers/hwmon/asc7621.c | |||
@@ -512,7 +512,7 @@ static ssize_t show_pwm_ac(struct device *dev, | |||
512 | { | 512 | { |
513 | SETUP_SHOW_DATA_PARAM(dev, attr); | 513 | SETUP_SHOW_DATA_PARAM(dev, attr); |
514 | u8 config, altbit, regval; | 514 | u8 config, altbit, regval; |
515 | const u8 map[] = { | 515 | static const u8 map[] = { |
516 | 0x01, 0x02, 0x04, 0x1f, 0x00, 0x06, 0x07, 0x10, | 516 | 0x01, 0x02, 0x04, 0x1f, 0x00, 0x06, 0x07, 0x10, |
517 | 0x08, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f | 517 | 0x08, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f |
518 | }; | 518 | }; |
@@ -533,7 +533,7 @@ static ssize_t store_pwm_ac(struct device *dev, | |||
533 | SETUP_STORE_DATA_PARAM(dev, attr); | 533 | SETUP_STORE_DATA_PARAM(dev, attr); |
534 | unsigned long reqval; | 534 | unsigned long reqval; |
535 | u8 currval, config, altbit, newval; | 535 | u8 currval, config, altbit, newval; |
536 | const u16 map[] = { | 536 | static const u16 map[] = { |
537 | 0x04, 0x00, 0x01, 0xff, 0x02, 0xff, 0x05, 0x06, | 537 | 0x04, 0x00, 0x01, 0xff, 0x02, 0xff, 0x05, 0x06, |
538 | 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, | 538 | 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, |
539 | 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | 539 | 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, |