If any particular value was to be checked against, it would need to be
IRQ_VECTOR_UNASSIGNED.

Reported-by: Roger Pau Monné <roger....@citrix.com>

Be more strict though and use valid_irq_vector() instead.

Take the opportunity and also convert local variables to unsigned int.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
Reviewed-by: Roger Pau Monné <roger....@citrix.com>
Acked-by: Andrew Cooper <andrew.coop...@citrix.com>
---
v2: New.

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -283,14 +283,13 @@ void destroy_irq(unsigned int irq)
  
  static void _clear_irq_vector(struct irq_desc *desc)
  {
-    unsigned int cpu;
-    int vector, old_vector, irq = desc->irq;
+    unsigned int cpu, old_vector, irq = desc->irq;
+    unsigned int vector = desc->arch.vector;
      cpumask_t tmp_mask;
  
-    BUG_ON(!desc->arch.vector);
+    BUG_ON(!valid_irq_vector(vector));
  
      /* Always clear desc->arch.vector */
-    vector = desc->arch.vector;
      cpumask_and(&tmp_mask, desc->arch.cpu_mask, &cpu_online_map);
  
      for_each_cpu(cpu, &tmp_mask) {
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to