From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: 104-idi-48e: make array register_offset static, makes object smaller
Date: Sun, 06 Oct 2019 15:07:59 +0000 [thread overview]
Message-ID: <20191006150759.GA68457@icarus> (raw)
In-Reply-To: <20191006144256.23733-1-colin.king@canonical.com>
On Sun, Oct 06, 2019 at 03:42:56PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/gpio/gpio-104-idi-48.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c
> index ff53887bdaa8..c95c93ec0bd7 100644
> --- a/drivers/gpio/gpio-104-idi-48.c
> +++ b/drivers/gpio/gpio-104-idi-48.c
> @@ -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;
>
> --
> 2.20.1
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
WARNING: multiple messages have this Message-ID (diff)
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Colin King <colin.king@canonical.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: 104-idi-48e: make array register_offset static, makes object smaller
Date: Sun, 6 Oct 2019 11:07:59 -0400 [thread overview]
Message-ID: <20191006150759.GA68457@icarus> (raw)
In-Reply-To: <20191006144256.23733-1-colin.king@canonical.com>
On Sun, Oct 06, 2019 at 03:42:56PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/gpio/gpio-104-idi-48.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c
> index ff53887bdaa8..c95c93ec0bd7 100644
> --- a/drivers/gpio/gpio-104-idi-48.c
> +++ b/drivers/gpio/gpio-104-idi-48.c
> @@ -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;
>
> --
> 2.20.1
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
next prev parent reply other threads:[~2019-10-06 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-06 14:42 [PATCH] gpio: 104-idi-48e: make array register_offset static, makes object smaller Colin King
2019-10-06 14:42 ` Colin King
2019-10-06 15:07 ` William Breathitt Gray [this message]
2019-10-06 15:07 ` William Breathitt Gray
2019-10-09 16:22 ` Bartosz Golaszewski
2019-10-09 16:22 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191006150759.GA68457@icarus \
--to=vilhelm.gray@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.