From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Colin King <colin.king@canonical.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: speedstep-lib: make several arrays static, makes code smaller
Date: Thu, 31 Aug 2017 01:32:53 +0200 [thread overview]
Message-ID: <3397376.XDXHdZtiYO@aspire.rjw.lan> (raw)
In-Reply-To: <20170825170016.23719-1-colin.king@canonical.com>
On Friday, August 25, 2017 7:00:16 PM CEST Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate arrays on the stack, instead make them static.
> Makes the object code smaller by over 860 bytes:
>
> Before:
> text data bss dec hex filename
> 10716 5196 0 15912 3e28 drivers/cpufreq/speedstep-lib.o
>
> After:
> text data bss dec hex filename
> 9690 5356 0 15046 3ac6 drivers/cpufreq/speedstep-lib.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/cpufreq/speedstep-lib.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/speedstep-lib.c b/drivers/cpufreq/speedstep-lib.c
> index 1b8062182c81..ccab452a4ef5 100644
> --- a/drivers/cpufreq/speedstep-lib.c
> +++ b/drivers/cpufreq/speedstep-lib.c
> @@ -35,7 +35,7 @@ static int relaxed_check;
> static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
> {
> /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
> - struct {
> + static const struct {
> unsigned int ratio; /* Frequency Multiplier (x10) */
> u8 bitmap; /* power on configuration bits
> [27, 25:22] (in MSR 0x2a) */
> @@ -58,7 +58,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
> };
>
> /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */
> - struct {
> + static const struct {
> unsigned int value; /* Front Side Bus speed in MHz */
> u8 bitmap; /* power on configuration bits [18: 19]
> (in MSR 0x2a) */
>
Applied, thanks!
prev parent reply other threads:[~2017-08-30 23:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 17:00 Colin King
2017-08-30 23:32 ` Rafael J. Wysocki [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=3397376.XDXHdZtiYO@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=viresh.kumar@linaro.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
all inboxes | Powered by JetHome®