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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to