[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 4/6] xen/arm: vgic: Optimize the way to store the target vCPU in the rank



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.