From: Joe Perches <joe@perches.com>
To: Colin Ian King <colin.i.king@gmail.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
linux-pm@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: longhaul: Make array speeds static const
Date: Thu, 03 Nov 2022 07:15:24 -0700 [thread overview]
Message-ID: <aec9ee4b771b70d0839d51b836e6301f0a2a1276.camel@perches.com> (raw)
In-Reply-To: <20221103132141.79671-1-colin.i.king@gmail.com>
On Thu, 2022-11-03 at 13:21 +0000, Colin Ian King wrote:
> Don't populate the read-only array speeds on the stack but instead
> make it static. Also makes the object code a little smaller.
[]
> diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
[]
> @@ -407,7 +407,7 @@ static int guess_fsb(int mult)
> {
> int speed = cpu_khz / 1000;
> int i;
> - int speeds[] = { 666, 1000, 1333, 2000 };
> + static const int speeds[] = { 666, 1000, 1333, 2000 };
> int f_max, f_min;
>
> for (i = 0; i < 4; i++) {
style trivia: the loop test is probably better using ARRAY_SIZE
for (i = 0; i < ARRAY_SIZE(speeds); i++)
next prev parent reply other threads:[~2022-11-03 14:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 13:21 [PATCH] cpufreq: longhaul: Make array speeds static const Colin Ian King
2022-11-03 14:15 ` Joe Perches [this message]
2022-11-03 14:30 ` Colin King (gmail)
2022-11-03 14:37 ` Viresh Kumar
2022-11-03 14:46 ` Colin King (gmail)
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=aec9ee4b771b70d0839d51b836e6301f0a2a1276.camel@perches.com \
--to=joe@perches.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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