From: Guenter Roeck <linux@roeck-us.net>
To: Colin King <colin.king@canonical.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
linux-watchdog@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: asm9260_wdt: make array mode_name static, shrinks object size
Date: Thu, 29 Nov 2018 15:40:46 -0800 [thread overview]
Message-ID: <20181129234046.GA19718@roeck-us.net> (raw)
In-Reply-To: <20181129232500.5039-1-colin.king@canonical.com>
On Thu, Nov 29, 2018 at 11:25:00PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const array mode_name on the stack but instead
> make it static. Makes the object code smaller by 41 bytes:
>
> Before:
> text data bss dec hex filename
> 7699 1872 0 9571 2563 drivers/watchdog/asm9260_wdt.o
>
> After:
> text data bss dec hex filename
> 7594 1936 0 9530 253a drivers/watchdog/asm9260_wdt.o
>
> (gcc version 8.2.0 x86_64)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/asm9260_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/asm9260_wdt.c b/drivers/watchdog/asm9260_wdt.c
> index 2cf56b459d84..9768e44ffeb8 100644
> --- a/drivers/watchdog/asm9260_wdt.c
> +++ b/drivers/watchdog/asm9260_wdt.c
> @@ -278,7 +278,7 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
> struct watchdog_device *wdd;
> struct resource *res;
> int ret;
> - const char * const mode_name[] = { "hw", "sw", "debug", };
> + static const char * const mode_name[] = { "hw", "sw", "debug", };
>
> priv = devm_kzalloc(&pdev->dev, sizeof(struct asm9260_wdt_priv),
> GFP_KERNEL);
> --
> 2.19.1
>
prev parent reply other threads:[~2018-11-29 23:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 23:25 [PATCH] watchdog: asm9260_wdt: make array mode_name static, shrinks object size Colin King
2018-11-29 23:40 ` Guenter Roeck [this message]
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=20181129234046.GA19718@roeck-us.net \
--to=linux@roeck-us.net \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).