Remove bool return code from evtchn_set_pending() and callers.
authorKeir Fraser <keir@xen.org>
Thu, 10 May 2012 10:58:33 +0000 (11:58 +0100)
committerKeir Fraser <keir@xen.org>
Thu, 10 May 2012 10:58:33 +0000 (11:58 +0100)
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vmsi.c
xen/common/event_channel.c
xen/drivers/passthrough/io.c
xen/include/asm-x86/hvm/hvm.h
xen/include/xen/event.h

index 517b6b31f9dbd28ddc88e0a5e4dca4165bd8b3b7..cfc7c80b7548338548ba052456637e1eec79daf8 100644 (file)
@@ -111,7 +111,7 @@ int vmsi_deliver(
     return 1;
 }
 
-int vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci)
+void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci)
 {
     uint32_t flags = pirq_dpci->gmsi.gflags;
     int vector = pirq_dpci->gmsi.gvec;
@@ -129,7 +129,6 @@ int vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci)
     ASSERT(pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI);
 
     vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
-    return 1;
 }
 
 /* Return value, -1 : multi-dests, non-negative value: dest_vcpu_id */
index 17ccb84ad2f0c28c2cb1fdef671493e0f4d4d1f2..53777f88881f50cac23d480a80c3593ed30217a4 100644 (file)
@@ -94,7 +94,7 @@ 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 evtchn_set_pending(struct vcpu *v, int port);
+static void evtchn_set_pending(struct vcpu *v, int port);
 
 static int virq_is_global(uint32_t virq)
 {
@@ -594,9 +594,7 @@ int evtchn_send(struct domain *d, unsigned int lport)
         if ( consumer_is_xen(rchn) )
             (*xen_notification_fn(rchn))(rvcpu, rport);
         else
-        {
             evtchn_set_pending(rvcpu, rport);
-        }
         break;
     case ECS_IPI:
         evtchn_set_pending(ld->vcpu[lchn->notify_vcpu_id], lport);
@@ -614,7 +612,7 @@ out:
     return ret;
 }
 
-static int evtchn_set_pending(struct vcpu *v, int port)
+static void evtchn_set_pending(struct vcpu *v, int port)
 {
     struct domain *d = v->domain;
     int vcpuid;
@@ -627,7 +625,7 @@ static int evtchn_set_pending(struct vcpu *v, int port)
      */
 
     if ( test_and_set_bit(port, &shared_info(d, evtchn_pending)) )
-        return 1;
+        return;
 
     if ( !test_bit        (port, &shared_info(d, evtchn_mask)) &&
          !test_and_set_bit(port / BITS_PER_EVTCHN_WORD(d),
@@ -638,7 +636,7 @@ static int evtchn_set_pending(struct vcpu *v, int port)
     
     /* Check if some VCPU might be polling for this event. */
     if ( likely(bitmap_empty(d->poll_mask, d->max_vcpus)) )
-        return 0;
+        return;
 
     /* Wake any interested (or potentially interested) pollers. */
     for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
@@ -653,8 +651,6 @@ static int evtchn_set_pending(struct vcpu *v, int port)
             vcpu_unblock(v);
         }
     }
-
-    return 0;
 }
 
 int guest_enabled_event(struct vcpu *v, uint32_t virq)
@@ -710,7 +706,7 @@ static void send_guest_global_virq(struct domain *d, uint32_t virq)
     spin_unlock_irqrestore(&v->virq_lock, flags);
 }
 
-int send_guest_pirq(struct domain *d, const struct pirq *pirq)
+void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
     struct evtchn *chn;
@@ -724,11 +720,11 @@ int send_guest_pirq(struct domain *d, const struct pirq *pirq)
     if ( pirq == NULL || (port = pirq->evtchn) == 0 )
     {
         BUG_ON(!is_hvm_domain(d));
-        return 0;
+        return;
     }
 
     chn = evtchn_from_port(d, port);
-    return evtchn_set_pending(d->vcpu[chn->notify_vcpu_id], port);
+    evtchn_set_pending(d->vcpu[chn->notify_vcpu_id], port);
 }
 
 static struct domain *global_virq_handlers[NR_VIRQS] __read_mostly;
index b4dc641eae0cfa36b33d0ae069f7030e74f03410..29b815f3af06c80a78d04765ac756693fd26f1c1 100644 (file)
@@ -469,14 +469,15 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector)
     spin_unlock(&d->event_lock);
 }
 
-static int hvm_pci_msi_assert(struct domain *d,
-                              struct hvm_pirq_dpci *pirq_dpci)
+static void hvm_pci_msi_assert(
+    struct domain *d, struct hvm_pirq_dpci *pirq_dpci)
 {
     struct pirq *pirq = dpci_pirq(pirq_dpci);
 
-    return (hvm_domain_use_pirq(d, pirq)
-            ? send_guest_pirq(d, pirq)
-            : vmsi_deliver_pirq(d, pirq_dpci));
+    if ( hvm_domain_use_pirq(d, pirq) )
+        send_guest_pirq(d, pirq);
+    else
+        vmsi_deliver_pirq(d, pirq_dpci);
 }
 
 static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
index c34b9535cbe1c69b071d903fad03027cbeef8eda..22f94513eac0ef5154cd30bee58571273c390b8d 100644 (file)
@@ -219,7 +219,7 @@ int vmsi_deliver(
     uint8_t dest, uint8_t dest_mode,
     uint8_t delivery_mode, uint8_t trig_mode);
 struct hvm_pirq_dpci;
-int vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *);
+void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *);
 int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 
 #define hvm_paging_enabled(v) \
index 11a639adff2f55274b631358c6329c9f0f2528ed..71c3e92a1248b051b08033466d0d444aca7e3fe7 100644 (file)
@@ -39,9 +39,8 @@ int set_global_virq_handler(struct domain *d, uint32_t virq);
  * send_guest_pirq:
  *  @d:        Domain to which physical IRQ should be sent
  *  @pirq:     Physical IRQ number
- * Returns TRUE if the delivery port was already pending.
  */
-int send_guest_pirq(struct domain *, const struct pirq *);
+void send_guest_pirq(struct domain *, const struct pirq *);
 
 /* Send a notification from a given domain's event-channel port. */
 int evtchn_send(struct domain *d, unsigned int lport);