]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: 104-idi-48e: make array register_offset static, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Sun, 6 Oct 2019 14:42:56 +0000 (15:42 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 9 Oct 2019 16:21:50 +0000 (18:21 +0200)
Don't populate the array register_offset on the stack but instead make it
static. Makes the object code smaller by 63 bytes.  Also add the int type
specifier to clean up a checkpatch warning.

Before:
   text    data     bss     dec     hex filename
   9212    5712    1408   16332    3fcc drivers/gpio/gpio-104-idi-48.o

After:
   text    data     bss     dec     hex filename
   9085    5776    1408   16269    3f8d drivers/gpio/gpio-104-idi-48.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-104-idi-48.c

index ff53887bdaa8aca6e2de65bf8107b65e473a0bdb..79dead61e7763568ab58a698bd53d5a6371e3db5 100644 (file)
@@ -65,7 +65,7 @@ static int idi_48_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
        struct idi_48_gpio *const idi48gpio = gpiochip_get_data(chip);
        unsigned i;
-       const unsigned register_offset[6] = { 0, 1, 2, 4, 5, 6 };
+       static const unsigned int register_offset[6] = { 0, 1, 2, 4, 5, 6 };
        unsigned base_offset;
        unsigned mask;