From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v5 4/9] x86/intel_pstate: relocate the driver register function Date: Thu, 17 Sep 2015 16:38:50 +0100 Message-ID: <55FADE8A.8040904@citrix.com> References: <1442197930-3738-1-git-send-email-wei.w.wang@intel.com> <1442197930-3738-5-git-send-email-wei.w.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1442197930-3738-5-git-send-email-wei.w.wang@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Wang , jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 14/09/15 03:32, Wei Wang wrote: > Move the driver register function to > the cpufreq.c. > > Signed-off-by: Wei Wang > --- > xen/drivers/cpufreq/cpufreq.c | 15 +++++++++++++++ > xen/include/acpi/cpufreq/cpufreq.h | 27 +-------------------------- > 2 files changed, 16 insertions(+), 26 deletions(-) > > changes in v5: > 1) keep cpufreq_presmp_init() intact. > > diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c > index 567e9e9..0c437d4 100644 > --- a/xen/drivers/cpufreq/cpufreq.c > +++ b/xen/drivers/cpufreq/cpufreq.c > @@ -638,3 +638,18 @@ static int __init cpufreq_presmp_init(void) > } > presmp_initcall(cpufreq_presmp_init); > > +int cpufreq_register_driver(struct cpufreq_driver *driver_data) > +{ > + if ( !driver_data || !driver_data->init || > + !driver_data->verify || !driver_data->exit || > + (!driver_data->target == !driver_data->setpolicy) ) This line will incur the wrath of newer GCC's which have warnings against such logic. Either bracket the (!driver_data->$X) or alter the logic itself. Also, the commit message needs to be corrected to state that you are also introducing a new check to the registration function. ~Andrew