From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v5 4/6] xen/arm: vgic: Optimize the way to store the target vCPU in the rank Date: Fri, 13 Nov 2015 15:49:22 +0000 Message-ID: <56460682.1020605@citrix.com> References: <1447084181-13677-1-git-send-email-julien.grall@citrix.com> <1447084181-13677-5-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZxGcl-0000L1-2a for xen-devel@lists.xenproject.org; Fri, 13 Nov 2015 15:50:51 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On 13/11/15 15:44, Stefano Stabellini wrote: > On Mon, 9 Nov 2015, Julien Grall wrote: >> -static struct vcpu *vgic_v3_get_target_vcpu(struct vcpu *v, unsigned int irq) >> -{ >> - struct vcpu *v_target; >> - struct vgic_irq_rank *rank = vgic_rank_irq(v, irq); >> +#define NR_BYTES_PER_IROUTER 8U > > Given the way this constant is used, it might be better to define it as > a bit shift of 3, removing the two division operations below. It makes more sense to define the constant with 8 rather than 3. As the compiler will replace the division by 8 with a shift of 3, I choose the readability and let the compiler do it's job. Regards, -- Julien Grall