]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen/evtchn: Cleanup for virq_is_global() infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sun, 21 Jan 2018 17:21:05 +0000 (17:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Jan 2018 10:28:59 +0000 (10:28 +0000)
Switch it, and the arch infrastructure, to return bool.  Drop the unnecessary
rc variable, and remove a redundant assertion from send_global_virq().

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/event_channel.c
xen/include/asm-arm/event.h
xen/include/asm-x86/event.h

index be834c5c78ee70deb2566651ec97174e85cad233..c62046590be584de3747b45cfedcf1110f6e13a0 100644 (file)
@@ -93,29 +93,22 @@ static uint8_t get_xen_consumer(xen_event_channel_notification_t fn)
 /* Get the notification function for a given Xen-bound event channel. */
 #define xen_notification_fn(e) (xen_consumers[(e)->xen_consumer-1])
 
-static int virq_is_global(uint32_t virq)
+static bool virq_is_global(unsigned int virq)
 {
-    int rc;
-
-    ASSERT(virq < NR_VIRQS);
-
     switch ( virq )
     {
     case VIRQ_TIMER:
     case VIRQ_DEBUG:
     case VIRQ_XENOPROF:
     case VIRQ_XENPMU:
-        rc = 0;
-        break;
+        return false;
+
     case VIRQ_ARCH_0 ... VIRQ_ARCH_7:
-        rc = arch_virq_is_global(virq);
-        break;
-    default:
-        rc = 1;
-        break;
+        return arch_virq_is_global(virq);
     }
 
-    return rc;
+    ASSERT(virq < NR_VIRQS);
+    return true;
 }
 
 
@@ -809,7 +802,6 @@ static DEFINE_SPINLOCK(global_virq_handlers_lock);
 
 void send_global_virq(uint32_t virq)
 {
-    ASSERT(virq < NR_VIRQS);
     ASSERT(virq_is_global(virq));
 
     send_guest_global_virq(global_virq_handlers[virq] ?: hardware_domain, virq);
index caefa506a97eef20ce8b6b845e3f512f0e1013d2..2b20d1aa15457a65d001cc66ca5d837830d76108 100644 (file)
@@ -54,9 +54,9 @@ static inline void local_event_delivery_enable(void)
 }
 
 /* No arch specific virq definition now. Default to global. */
-static inline int arch_virq_is_global(int virq)
+static inline bool arch_virq_is_global(unsigned int virq)
 {
-    return 1;
+    return true;
 }
 
 #endif
index a91599d0ec36d21462344d3a7f621fb8192b0864..2f6ea54bcb9bc936e60c33891bf3a1b476723b6a 100644 (file)
@@ -42,9 +42,9 @@ static inline void local_event_delivery_enable(void)
 }
 
 /* No arch specific virq definition now. Default to global. */
-static inline int arch_virq_is_global(uint32_t virq)
+static inline bool arch_virq_is_global(unsigned int virq)
 {
-    return 1;
+    return true;
 }
 
 #endif