[XEN,v3,04/11] xen: arm: remove is_assignable_irq
diff mbox series

Message ID 20191115200115.44890-5-stewart.hildebrand@dornerworks.com
State New
Headers show
Series
  • xen: arm: context switch vtimer PPI state
Related show

Commit Message

Stewart Hildebrand Nov. 15, 2019, 8:01 p.m. UTC
It only had 1 caller.

Reverse the condition for readability.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>

---
v3: new patch
---
 xen/arch/arm/irq.c        | 9 ++-------
 xen/include/asm-arm/irq.h | 2 --
 2 files changed, 2 insertions(+), 9 deletions(-)

Comments

Julien Grall Nov. 23, 2019, 7:28 p.m. UTC | #1
Hi,

On 15/11/2019 20:01, Stewart Hildebrand wrote:
> It only had 1 caller.
If this is the only reason, then I would prefer to keep it as it makes 
easier to reason. So are you removing it because the function 
is_assignable_irq() and route_irq_to_guest() are not going to be re-used 
for PPIs?

If so, we should rename the function route_irq_to_guest() to clarify 
this can only be used on SPIs.

Cheers,

Patch
diff mbox series

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 9cc0a54867..c80782026f 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -390,12 +390,6 @@  err:
     return rc;
 }
 
-bool is_assignable_irq(unsigned int irq)
-{
-    /* For now, we can only route SPIs to the guest */
-    return (irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines());
-}
-
 /*
  * Only the hardware domain is allowed to set the configure the
  * interrupt type for now.
@@ -509,7 +503,8 @@  int route_irq_to_guest(struct domain *d, unsigned int virq,
         return -EINVAL;
     }
 
-    if ( !is_assignable_irq(irq) )
+    /* For now, we can only route SPIs to the guest */
+    if ( (irq < NR_LOCAL_IRQS) || (irq >= gic_number_lines()) )
     {
         printk(XENLOG_G_ERR "the IRQ%u is not routable\n", irq);
         return -EINVAL;
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index e45d574598..e14001b5c6 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -70,8 +70,6 @@  static inline bool is_lpi(unsigned int irq)
 
 #define domain_pirq_to_irq(d, pirq) (pirq)
 
-bool is_assignable_irq(unsigned int irq);
-
 void init_IRQ(void);
 void init_secondary_IRQ(void);