leds: aat1290: make array max_mm_current_percent static const
authorColin Ian King <colin.king@canonical.com>
Thu, 24 Aug 2017 13:00:52 +0000 (14:00 +0100)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Tue, 29 Aug 2017 19:10:38 +0000 (21:10 +0200)
Don't populate the array max_mm_current_percent on the stack, instead
make it static const.  Makes the object code smaller by over 280 bytes:

Before:
   text    data     bss     dec     hex filename
   7225    1936      64    9225    2409 ./drivers/leds/leds-aat1290.o

After:
   text    data     bss     dec     hex filename
   6847    2032      64    8943    22ef ./drivers/leds/leds-aat1290.o`

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-aat1290.c

index a21e19297745dd4337f4505aa0f2341ed92bbfe0..35fcb0ca909295e404caefdfdefcb8218a9d1d93 100644 (file)
@@ -314,8 +314,10 @@ static void aat1290_led_validate_mm_current(struct aat1290_led *led,
 static int init_mm_current_scale(struct aat1290_led *led,
                        struct aat1290_led_config_data *cfg)
 {
-       int max_mm_current_percent[] = { 20, 22, 25, 28, 32, 36, 40, 45, 50, 56,
-                                               63, 71, 79, 89, 100 };
+       static const int max_mm_current_percent[] = {
+               20, 22, 25, 28, 32, 36, 40, 45, 50, 56,
+               63, 71, 79, 89, 100
+       };
        int i, max_mm_current =
                        AAT1290_MAX_MM_CURRENT(cfg->max_flash_current);