public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Colin King (gmail)" <colin.i.king@gmail.com>
To: Joe Perches <joe@perches.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, 3 Nov 2022 14:30:10 +0000	[thread overview]
Message-ID: <c0490cb3-28d2-457c-8ae6-89d07b8b7577@gmail.com> (raw)
In-Reply-To: <aec9ee4b771b70d0839d51b836e6301f0a2a1276.camel@perches.com>

On 03/11/2022 14:15, Joe Perches wrote:
> 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++)
> 
I'll send a V2 for that. Good idea.

Colin

  reply	other threads:[~2022-11-03 14:30 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
2022-11-03 14:30   ` Colin King (gmail) [this message]
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=c0490cb3-28d2-457c-8ae6-89d07b8b7577@gmail.com \
    --to=colin.i.king@gmail.com \
    --cc=joe@perches.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