Skip to contentSkip to conversation

x86/vpic: fix vpic_elcr_mask macro parameter usage

PATCH In review Roger Pau Monne 2 participants 2 messages Aug 19, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/vpic: fix vpic_elcr_mask macro parameter usage

vpic_elcr_mask wasn't using the v parameter, and instead worked because in the context of the callers v would be vpic. Fix this by correctly using the parameter. While there also remove the unneeded casts to uint8_t and the ending semicolon.

No functional change intended.

---
 xen/arch/x86/hvm/vpic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/vpic.c +1 -1
index ea38903d3f..27ad4bef3f 100644
@@ -41,7 +41,7 @@
 #define vpic_lock(v)   spin_lock(__vpic_lock(v))
 #define vpic_unlock(v) spin_unlock(__vpic_lock(v))
 #define vpic_is_locked(v) spin_is_locked(__vpic_lock(v))
-#define vpic_elcr_mask(v) (vpic->is_master ? (uint8_t)0xf8 : (uint8_t)0xde);
+#define vpic_elcr_mask(v) ((v)->is_master ? 0xf8 : 0xde)
 
 /* Return the highest priority found in mask. Return 8 if none. */
 #define VPIC_PRIO_NONE 8
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Roger Pau Monne

vpic_elcr_mask wasn't using the v parameter, and instead worked because in the context of the callers v would be vpic. Fix this by correctly using the parameter. While there also remove the unneeded casts to uint8_t and the ending semicolon.

No functional change intended.