Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732AbbDMTce (ORCPT ); Mon, 13 Apr 2015 15:32:34 -0400 Received: from mga03.intel.com ([134.134.136.65]:6608 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbbDMTcb convert rfc822-to-8bit (ORCPT ); Mon, 13 Apr 2015 15:32:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,571,1422950400"; d="scan'208";a="679490098" Date: Mon, 13 Apr 2015 12:32:30 -0700 From: Kristen Carlson Accardi To: "Rafael J. Wysocki" Cc: Borislav Petkov , LKML , Viresh Kumar , Subject: Re: [PATCH] cpufreq/intel_pstate: Fix an annoying !CONFIG_SMP warning Message-ID: <20150413123230.065b795c@kcaccard-desk.amr.corp.intel.com> In-Reply-To: <7709303.8dfyH4hoC9@vostro.rjw.lan> References: <1428067193-9608-1-git-send-email-bp@alien8.de> <7709303.8dfyH4hoC9@vostro.rjw.lan> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3233 Lines: 97 On Sat, 11 Apr 2015 02:22:03 +0200 "Rafael J. Wysocki" wrote: > On Friday, April 03, 2015 03:19:53 PM Borislav Petkov wrote: > > From: Borislav Petkov > > > > I keep seeing > > > > drivers/cpufreq/intel_pstate.c: In function ‘intel_pstate_init’: > > drivers/cpufreq/intel_pstate.c:1187:26: warning: initialization from incompatible pointer type > > struct cpuinfo_x86 *c = &boot_cpu_data; > > > > when doing randconfig builds. > > > > This is caused by the fact that when !CONFIG_SMP, asm/processor.h > > defines cpu_info to boot_cpu_data and the local variable > > > > struct cpu_defaults *cpu_info > > > > overshadows it leading to this unfortunate assignment in the > > preprocessed source: > > > > struct cpu_defaults *boot_cpu_data; > > struct cpuinfo_x86 *c = &boot_cpu_data; > > > > Rename the local variable and use static_cpu_has_safe() which alleviates > > the need for defining a local cpuinfo_x86 pointer. > > Kristen, any comments here? Seems fine to me. Acked-by: Kristen Carlson Accardi > > > Signed-off-by: Borislav Petkov > > Cc: Kristen Carlson Accardi > > Cc: "Rafael J. Wysocki" > > Cc: Viresh Kumar > > Cc: linux-pm@vger.kernel.org > > --- > > drivers/cpufreq/intel_pstate.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c > > index 872c5772c5d3..0b883f131a73 100644 > > --- a/drivers/cpufreq/intel_pstate.c > > +++ b/drivers/cpufreq/intel_pstate.c > > @@ -31,6 +31,7 @@ > > #include > > #include > > #include > > +#include > > > > #define BYT_RATIOS 0x66a > > #define BYT_VIDS 0x66b > > @@ -1183,8 +1184,7 @@ static int __init intel_pstate_init(void) > > { > > int cpu, rc = 0; > > const struct x86_cpu_id *id; > > - struct cpu_defaults *cpu_info; > > - struct cpuinfo_x86 *c = &boot_cpu_data; > > + struct cpu_defaults *cpu_def; > > > > if (no_load) > > return -ENODEV; > > @@ -1200,10 +1200,10 @@ static int __init intel_pstate_init(void) > > if (intel_pstate_platform_pwr_mgmt_exists()) > > return -ENODEV; > > > > - cpu_info = (struct cpu_defaults *)id->driver_data; > > + cpu_def = (struct cpu_defaults *)id->driver_data; > > > > - copy_pid_params(&cpu_info->pid_policy); > > - copy_cpu_funcs(&cpu_info->funcs); > > + copy_pid_params(&cpu_def->pid_policy); > > + copy_cpu_funcs(&cpu_def->funcs); > > > > if (intel_pstate_msrs_not_valid()) > > return -ENODEV; > > @@ -1214,7 +1214,7 @@ static int __init intel_pstate_init(void) > > if (!all_cpu_data) > > return -ENOMEM; > > > > - if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp) > > + if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp) > > intel_pstate_hwp_enable(); > > > > if (!hwp_active && hwp_only) > > > -- 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/