From: "Jan Beulich" Subject: Re: [PATCH v4 11/11] tools: enable xenpm to control the intel_pstate driver Date: Tue, 07 Jul 2015 13:05:21 +0100 Message-ID: <559BDCA1020000780008D616@mail.emea.novell.com> References: <1435231145-23288-1-git-send-email-wei.w.wang@intel.com> <20150707085500.GN1134@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150707085500.GN1134@zion.uk.xensource.com> Content-Disposition: inline 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.liu2@citrix.com, Wei Wang Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 07.07.15 at 10:55, wrote: > On Thu, Jun 25, 2015 at 07:19:05PM +0800, Wei Wang wrote: >> --- a/tools/libxc/include/xenctrl.h >> +++ b/tools/libxc/include/xenctrl.h >> @@ -2266,8 +2266,18 @@ struct xc_get_cpufreq_para { >> uint32_t scaling_cur_freq; >> >> char scaling_governor[CPUFREQ_NAME_LEN]; >> - uint32_t scaling_max_freq; >> - uint32_t scaling_min_freq; >> + >> + union { >> + uint32_t freq; >> + uint32_t pct; >> + } scaling_max; >> + >> + union { >> + uint32_t freq; >> + uint32_t pct; >> + } scaling_min; >> + > > Don't you need struct? I don't see how union would work for you, you > clearly need bot freq and pct at the same time. Why? The current driver uses freq; intel_pstate uses pct. What looks wrong is the code below using both fields at once. Jan