[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7b705e6-584b-4655-b005-521be3f23c1e@epam.com>
Date: Mon, 13 Nov 2023 17:35:09 +0000
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@...m.com>
To: Juergen Gross <jgross@...e.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Stefano Stabellini <sstabellini@...nel.org>,
"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>
Subject: Re: [PATCH 4/7] xen/events: remove some simple helpers from
events_base.c
On 16.10.23 09:28, Juergen Gross wrote:
Hello Juergen.
> The helper functions type_from_irq() and cpu_from_irq() are just one
> line functions used only internally.
>
> Open code them where needed. At the same time modify and rename
> get_evtchn_to_irq() to return a struct irq_info instead of the IRQ
> number.
>
> Signed-off-by: Juergen Gross <jgross@...e.com>
[snip]
>
> @@ -1181,15 +1172,16 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
> {
> int irq;
> int ret;
> + struct irq_info *info;
>
> if (evtchn >= xen_evtchn_max_channels())
> return -ENOMEM;
I assume this check is called here (*before* holding a lock) by
intention, as evtchn_to_info() below contains the same check.
>
> mutex_lock(&irq_mapping_update_lock);
>
> - irq = get_evtchn_to_irq(evtchn);
> + info = evtchn_to_info(evtchn) >
> - if (irq == -1) {
> + if (!info) {
> irq = xen_allocate_irq_dynamic();
> if (irq < 0)
> goto out;
> @@ -1212,8 +1204,8 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
> */
> bind_evtchn_to_cpu(evtchn, 0, false);
> } else {
> - struct irq_info *info = info_for_irq(irq);
> - WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
> + WARN_ON(info->type != IRQT_EVTCHN);
> + irq = info->irq;
> }
This hunk doesn't apply clearly to the latest state, because of
"9e90e58c11b7 xen: evtchn: Allow shared registration of IRQ handers"
went in. Please rebase.
With that:
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Also checkpatch.pl warns about BUG_ON usage in several places, but again
you didn't introduce them in current patch, just touched their args.
[snip]
Powered by blists - more mailing lists