From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [RFC PATCH V3 05/22] Change MAX_EVTCHNS macro to max_evtchns inline function Date: Thu, 28 Feb 2013 11:58:00 +0000 Message-ID: <512F4648.3020800@citrix.com> References: <1361975655-22295-1-git-send-email-wei.liu2@citrix.com> <1361975655-22295-6-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1361975655-22295-6-git-send-email-wei.liu2@citrix.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 Liu Cc: "Keir (Xen.org)" , Ian Campbell , "jbeulich@suse.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 27/02/13 14:33, Wei Liu wrote: > The calculation of max event channels depends on the actual ABI in use. Try to > avoid gcc-ism macro. [...] > +static inline unsigned int max_evtchns(struct domain *d) > +{ > + return BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d); > +} This value doesn't change over the life of the domain. Calculate it once and save it in a new d->max_evtchns field? David