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

[xen master] arm/vgic: fix coding style in macro REG_RANK_INDEX()



commit fc9e089ad2d4739336c7b2553a325c9b6c02c40d
Author:     Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
AuthorDate: Thu Aug 11 11:47:34 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Aug 11 11:47:34 2022 +0200

    arm/vgic: fix coding style in macro REG_RANK_INDEX()
    
    Add parentheses around the macro parameter 's' to prevent against unintended
    expansions. This, also, resolves a MISRA C 2012 Rule 20.7 violation warning.
    
    Add white spaces around the subtraction operator.
    
    Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
---
 xen/arch/arm/include/asm/vgic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index d2a9fc7d83..3d44868039 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -286,7 +286,7 @@ static inline paddr_t vgic_dist_base(const struct vgic_dist 
*vgic)
  * Offset of GICD_<FOO><n> with its rank, for GICD_<FOO> size <s> with
  * <b>-bits-per-interrupt.
  */
-#define REG_RANK_INDEX(b, n, s) ((((n) >> s) & ((b)-1)) % 32)
+#define REG_RANK_INDEX(b, n, s) ((((n) >> (s)) & ((b) - 1)) % 32)
 
 
 extern struct vcpu *vgic_get_target_vcpu(struct vcpu *v, unsigned int virq);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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