From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH 01/16] xen/events: refactor retrigger_dynirq() and resend_irq_on_evtchn() Date: Mon, 14 Oct 2013 11:59:45 -0400 Message-ID: <525C14F1.3080802@oracle.com> References: <1381236555-27493-1-git-send-email-david.vrabel@citrix.com> <1381236555-27493-2-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1381236555-27493-2-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 10/08/2013 08:49 AM, David Vrabel wrote: > From: David Vrabel > > These two function did the same thing with different parameters, put > the common bits in retrigger_evtchn(). > > This changes the return value of resend_irq_on_evtchn() but the only > caller (in arch/ia64/xen/irq_xen.c) ignored the return value so this > is fine. Not directly related to this patch, but why do we still have arch/ia64/xen? Is anyone testing it? I only see a few superficial changes in the log for last year, and those appear to be result of code inspection or some global changes, not actual execution. -boris > > Signed-off-by: David Vrabel > Acked-by: Konrad Rzeszutek Wilk > --- > drivers/xen/events.c | 27 +++++++++------------------ > 1 files changed, 9 insertions(+), 18 deletions(-) > > diff --git a/drivers/xen/events.c b/drivers/xen/events.c > index 4035e83..ddcdbb5 100644 > --- a/drivers/xen/events.c > +++ b/drivers/xen/events.c > @@ -1558,13 +1558,13 @@ static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, > return rebind_irq_to_cpu(data->irq, tcpu); > } > > -int resend_irq_on_evtchn(unsigned int irq) > +static int retrigger_evtchn(int evtchn) > { > - int masked, evtchn = evtchn_from_irq(irq); > + int masked; > struct shared_info *s = HYPERVISOR_shared_info; > > if (!VALID_EVTCHN(evtchn)) > - return 1; > + return 0; > > masked = sync_test_and_set_bit(evtchn, BM(s->evtchn_mask)); > sync_set_bit(evtchn, BM(s->evtchn_pending)); > @@ -1574,6 +1574,11 @@ int resend_irq_on_evtchn(unsigned int irq) > 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); > @@ -1608,21 +1613,7 @@ static void mask_ack_dynirq(struct irq_data *data) > > static int retrigger_dynirq(struct irq_data *data) > { > - int evtchn = evtchn_from_irq(data->irq); > - struct shared_info *sh = HYPERVISOR_shared_info; > - int ret = 0; > - > - if (VALID_EVTCHN(evtchn)) { > - int masked; > - > - masked = sync_test_and_set_bit(evtchn, BM(sh->evtchn_mask)); > - sync_set_bit(evtchn, BM(sh->evtchn_pending)); > - if (!masked) > - unmask_evtchn(evtchn); > - ret = 1; > - } > - > - return ret; > + return retrigger_evtchn(evtchn_from_irq(data->irq)); > } > > static void restore_pirqs(void)