summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-09-22 00:30:07 +0200
committerWolfram Sang <wsa@the-dreams.de>2017-10-17 23:49:56 +0200
commit4ce8e88f6c25469b83a7d56914995fe892d1f9a8 (patch)
tree9ff570f9fe610eb366501dd938bbab100bdfc5b8 /drivers/i2c
parentdt-bindings: i2c: i2c-davinci: Update binding for 66AK2Gx pwr dm property (diff)
downloadlinux-4ce8e88f6c25469b83a7d56914995fe892d1f9a8.tar.xz
linux-4ce8e88f6c25469b83a7d56914995fe892d1f9a8.zip
i2c: designware: make const array supported_speeds static to shink object code size
Don't populate const array supported_speeds on the stack, instead make it static. Makes the object code smaller by 150 bytes: Before: text data bss dec hex filename 8474 1440 0 9914 26ba i2c-designware-platdrv.o After: text data bss dec hex filename 8324 1440 0 9764 2624 i2c-designware-platdrv.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 16c027b62a20..58add69a441c 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -265,7 +265,9 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
u32 acpi_speed, ht = 0;
struct resource *mem;
int i, irq, ret;
- const int supported_speeds[] = { 0, 100000, 400000, 1000000, 3400000 };
+ static const int supported_speeds[] = {
+ 0, 100000, 400000, 1000000, 3400000
+ };
irq = platform_get_irq(pdev, 0);
if (irq < 0)