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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 13 Jul 2015 14:33:08 +0800
From:	Pan Xinhui <xinhuix.pan@...el.com>
To:	"Rafael J. Wysocki" <rafael@...nel.org>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"rjw@...ysocki.net" <rjw@...ysocki.net>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	"yanmin_zhang@...ux.intel.com" <yanmin_zhang@...ux.intel.com>,
	"mnipxh@....com" <mnipxh@....com>
Subject: Re: [PATCH] acpi-cpufreq: Add a miss ifdef CONFIG_X86_ACPI_CPUFREQ_CPB

hi, Rafeal
	thanks for your reply. :)

On 2015年07月11日 04:44, Rafael J. Wysocki wrote:
> Hi,
> 
> On Fri, Jul 10, 2015 at 7:50 AM, Pan Xinhui <xinhuix.pan@...el.com> wrote:
>>
>> If CONFIG_X86_ACPI_CPUFREQ_CPB has not been defined, the placeholder for
>> cpb is not needed. Add ifdef around it.
>>
>> Signed-off-by: Pan Xinhui <xinhuix.pan@...el.com>
>> ---
>>  drivers/cpufreq/acpi-cpufreq.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
>> index e7fcaa6..314a19e 100644
>> --- a/drivers/cpufreq/acpi-cpufreq.c
>> +++ b/drivers/cpufreq/acpi-cpufreq.c
>> @@ -884,7 +884,9 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
>>  static struct freq_attr *acpi_cpufreq_attr[] = {
>>         &cpufreq_freq_attr_scaling_available_freqs,
>>         &freqdomain_cpus,
>> +#ifdef CONFIG_X86_ACPI_CPUFREQ_CPB
>>         NULL,   /* this is a placeholder for cpb, do not remove */
>> +#endif
> 
> Adding the ifdef here doesn't change anything, because the next NULL
> will play the role of the one you've just #ifdefed and the structure
> will be filled with zeros from that point on anyway.
> 
Yes, adding ifdef here does not change any binary codes. But I want to make the codes more readable. :)
Patch author has noticed two *NULL* here would confuse people, especially who first read this acpi-cpufreq.c file
>From code style point, it would be better to have #ifdef around it. 

> You'd need to #ifdef it in the struct freq_attr definition, but I'm
> not sure it's worth the effort.
> 

struct freq_attr *cpb* is defined in #ifdef section. :)

thanks
xinhui

>>         NULL,
>>  };
> 
> Thanks,
> Rafael
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ