lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef637642-7d0f-66b8-2225-b6f8609f037e@gmail.com>
Date:   Thu, 3 Nov 2022 14:49:31 +0000
From:   "Colin King (gmail)" <colin.i.king@...il.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     "Rafael J . Wysocki" <rafael@...nel.org>, linux-pm@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: SPEAr: Make read-only array sys_clk_src static

On 03/11/2022 14:38, Viresh Kumar wrote:
> On 03-11-22, 14:36, Colin Ian King wrote:
>> Don't populate the read-only array sys_clk_src on the stack but instead
>> make it static and add in a missing const. Also makes the object code a
>> little smaller.
>>
>> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
>> ---
>>   drivers/cpufreq/spear-cpufreq.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
>> index 7d0d62a06bf3..c6fdf019dbde 100644
>> --- a/drivers/cpufreq/spear-cpufreq.c
>> +++ b/drivers/cpufreq/spear-cpufreq.c
>> @@ -39,7 +39,7 @@ static struct clk *spear1340_cpu_get_possible_parent(unsigned long newfreq)
>>   	 * In SPEAr1340, cpu clk's parent sys clk can take input from
>>   	 * following sources
>>   	 */
>> -	const char *sys_clk_src[] = {
>> +	static const char * const sys_clk_src[] = {
>>   		"sys_syn_clk",
>>   		"pll1_clk",
>>   		"pll2_clk",
> 
> Same questions from longhaul patch apply here too.
> 
See answer in that patch :-)

But really, this is kind of basic C level stuff. I suggest reading K&R 
2nd Edition, Section 4.6, last paragraph before exercise 4-11.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ