From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Colin King <colin.king@canonical.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: make const array supported_speeds static to shink object code size
Date: Fri, 22 Sep 2017 10:10:59 +0300 [thread overview]
Message-ID: <f2c03d85-da0d-7bb0-2f1a-5a3b298200e9@linux.intel.com> (raw)
In-Reply-To: <20170921223007.21081-1-colin.king@canonical.com>
On 09/22/2017 01:30 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 0e65b97842b4..8a7b29b9afbe 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -257,7 +257,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
> + };
>
Oh, this is so easy to forget.
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
next prev parent reply other threads:[~2017-09-22 7:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 22:30 [PATCH] i2c: designware: make const array supported_speeds static to shink object code size Colin King
2017-09-22 7:10 ` Jarkko Nikula [this message]
2017-10-17 21:50 ` Wolfram Sang
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=f2c03d85-da0d-7bb0-2f1a-5a3b298200e9@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox