xen/events: remove some unused/unnecessary code
cover xen/events: remove some unused/unnecessary code
Remove some unused and unnecessary event channel code.
David
PATCH 1/3 xen/events: remove the unused resend_irq_on_evtchn()
From: David Vrabel <[email protected]>
resend_irq_on_evtchn() was only used by ia64 (which no longer has Xen support).
--- drivers/xen/events/events_base.c | 33 ++++++++++++--------------------- include/xen/events.h | 1 - 2 files changed, 12 insertions(+), 22 deletions(-)
drivers/xen/events/events_base.c +12 -21
@@ -1344,26 +1344,6 @@ static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,return rebind_irq_to_cpu (data->irq, tcpu); } -static int retrigger_evtchn (int evtchn) -{ -int masked; - -if (!VALID_EVTCHN (evtchn)) -return 0 ; - - masked =test_and_set_mask (evtchn); -set_evtchn (evtchn); -if (!masked) -unmask_evtchn (evtchn); - -return 1 ; -} - -int resend_irq_on_evtchn (unsigned int irq) -{ -return retrigger_evtchn (evtchn_from_irq (irq)); -} -static void enable_dynirq (struct irq_data *data) {int evtchn =evtchn_from_irq (data->irq);
@@ -1398,7 +1378,18 @@ static void mask_ack_dynirq(struct irq_data *data)static int retrigger_dynirq (struct irq_data *data) { -return retrigger_evtchn (evtchn_from_irq (data->irq)); +unsigned int evtchn =evtchn_from_irq (data->irq); +int masked; + +if (!VALID_EVTCHN (evtchn)) +return 0 ; + + masked =test_and_set_mask (evtchn); +set_evtchn (evtchn); +if (!masked) +unmask_evtchn (evtchn); + +return 1 ; }static void restore_pirqs (void )
include/xen/events.h +0 -1
@@ -52,7 +52,6 @@ int evtchn_get(unsigned int evtchn);void evtchn_put (unsigned int evtchn);void xen_send_IPI_one (unsigned int cpu,enum ipi_vector vector); -int resend_irq_on_evtchn (unsigned int irq);void rebind_evtchn_irq (int evtchn,int irq);static inline void notify_remote_via_evtchn (int port)
Signature · 1 line
1.7.2.5
PATCH 2/3 xen/events: remove unnecessary call to bind_evtchn_to_cpu()
In reply to David VrabelFrom: David Vrabel <[email protected]>
Since bind_evtchn_to_cpu() is always called after an event channel is bound, there is no need to call it after closing an event channel.
--- drivers/xen/events/events_base.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/xen/events/events_base.c +0 -4
@@ -469,9 +469,6 @@ static void xen_evtchn_close(unsigned int port) close.port = port;if (HYPERVISOR_event_channel_op (EVTCHNOP_close, &close) !=0 )BUG (); - -/* Closed ports are implicitly re-bound to VCPU0. */ -bind_evtchn_to_cpu (port,0 ); }static void pirq_query_unmask (int irq)
@@ -1003,7 +1000,6 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu) irq = ret; goto out; } -bind_evtchn_to_cpu (evtchn, cpu); }else {struct irq_info *info =info_for_irq (irq);
Signature · 1 line
1.7.2.5
PATCH 3/3 xen/xenbus: remove unused xenbus_bind_evtchn()
In reply to David VrabelFrom: David Vrabel <[email protected]>
xenbus_bind_evtchn() has no callers so remove it.
--- drivers/xen/xenbus/xenbus_client.c | 27 --------------------------- include/xen/xenbus.h | 1 - 2 files changed, 0 insertions(+), 28 deletions(-)
drivers/xen/xenbus/xenbus_client.c +0 -27
@@ -401,33 +401,6 @@ EXPORT_SYMBOL_GPL(xenbus_alloc_evtchn);/** -* Bind to an existing interdomain event channel in another domain. Returns 0 -* on success and stores the local port in *port. On error, returns -errno, -* switches the device to XenbusStateClosing, and saves the error in XenStore. -*/ -int xenbus_bind_evtchn (struct xenbus_device *dev,int remote_port,int *port) -{ -struct evtchn_bind_interdomain bind_interdomain; -int err; - - bind_interdomain.remote_dom = dev->otherend_id; - bind_interdomain.remote_port = remote_port; - - err =HYPERVISOR_event_channel_op (EVTCHNOP_bind_interdomain, - &bind_interdomain); -if (err) -xenbus_dev_fatal (dev, err, -"binding to event channel %d from domain %d" , - remote_port, dev->otherend_id); -else - *port = bind_interdomain.local_port; - -return err; -} -EXPORT_SYMBOL_GPL (xenbus_bind_evtchn); - - -/** * Free an existing event channel. Returns 0 on success or -errno on error. */ int xenbus_free_evtchn (struct xenbus_device *dev,int port)
include/xen/xenbus.h +0 -1
@@ -207,7 +207,6 @@ int xenbus_unmap_ring(struct xenbus_device *dev, grant_handle_t handle, void *vaddr);int xenbus_alloc_evtchn (struct xenbus_device *dev,int *port); -int xenbus_bind_evtchn (struct xenbus_device *dev,int remote_port,int *port);int xenbus_free_evtchn (struct xenbus_device *dev,int port);enum xenbus_state xenbus_read_driver_state (const char *path);
Signature · 1 line
1.7.2.5
Quoted 4 lines · David Vrabel
Remove some unused and unnecessary event channel code.
David
I'd probably leave the blank line in bind_virq_to_irq() (second patch). Other than that