Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548AbbGMW7z (ORCPT ); Mon, 13 Jul 2015 18:59:55 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:64009 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751491AbbGMW7x convert rfc822-to-8bit (ORCPT ); Mon, 13 Jul 2015 18:59:53 -0400 From: "Rafael J. Wysocki" To: Pan Xinhui Cc: "Rafael J. Wysocki" , Linux Kernel Mailing List , "linux-pm@vger.kernel.org" , Viresh Kumar , "yanmin_zhang@linux.intel.com" , "mnipxh@163.com" Subject: Re: [PATCH] acpi-cpufreq: Add a miss ifdef CONFIG_X86_ACPI_CPUFREQ_CPB Date: Tue, 14 Jul 2015 01:26:28 +0200 Message-ID: <1591472.jfYRX9HXXv@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <55A35BA4.8020800@intel.com> References: <559F5D13.8050104@intel.com> <55A35BA4.8020800@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2168 Lines: 60 On Monday, July 13, 2015 02:33:08 PM Pan Xinhui wrote: > 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 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 > >> --- > >> 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. Not really. Why don't you simply drop *both* NULLs? > > > 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. :) Ah, OK. -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/