[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1505201628400.4225@nanos>
Date: Wed, 20 May 2015 16:48:39 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Jiang Liu <jiang.liu@...ux.intel.com>
cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Randy Dunlap <rdunlap@...radead.org>,
Yinghai Lu <yinghai@...nel.org>,
Borislav Petkov <bp@...en8.de>,
"David S. Miller" <davem@...emloft.net>, x86@...nel.org,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
Simon Horman <horms@...ge.net.au>,
Magnus Damm <magnus.damm@...il.com>,
bob picco <bpicco@...oft.net>,
Jason Cooper <jason@...edaemon.net>,
Kevin Cernekee <cernekee@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Marc Zyngier <marc.zyngier@....com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Tony Luck <tony.luck@...el.com>, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-acpi@...r.kernel.org,
sparclinux@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-sh@...r.kernel.org
Subject: Re: [Patch v2 06/14] genirq: Move field 'handler_data' from struct
irq_data into struct irq_common_data
On Wed, 20 May 2015, Jiang Liu wrote:
> Handler data (handler_data) is per-irq instead of per irqchip, so move
> it into struct irq_common_data.
For review and debugging sake, please do the same split as you did
with node. Convert first and then move. 5 patches this time:
Sparc:
> arch/sparc/kernel/irq_64.c | 15 +++++++++------
> arch/sparc/kernel/sun4d_irq.c | 4 ++--
> arch/sparc/kernel/sun4m_irq.c | 6 ++++--
x86:
> arch/x86/kernel/apic/msi.c | 2 +-
> arch/x86/kernel/hpet.c | 4 ++--
gpio:
> drivers/gpio/gpio-davinci.c | 2 +-
sh:
> drivers/sh/intc/virq.c | 4 ++--
Move:
> include/linux/irq.h | 8 ++++----
> include/linux/irqdesc.h | 2 +-
> kernel/irq/chip.c | 2 +-
> kernel/irq/irqdesc.c | 3 ++-
> diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
> index c5e05c82d67c..477d5b8616ab 100644
> --- a/drivers/gpio/gpio-davinci.c
> +++ b/drivers/gpio/gpio-davinci.c
> @@ -396,7 +396,7 @@ static int gpio_irq_type_unbanked(struct irq_data *data, unsigned trigger)
> struct davinci_gpio_regs __iomem *g;
> u32 mask;
>
> - d = (struct davinci_gpio_controller *)data->handler_data;
> + d = (struct davinci_gpio_controller *)irq_data_get_irq_handler_data(data);
This type cast is silly, handler_data is (void *)
> g = (struct davinci_gpio_regs __iomem *)d->regs;
> mask = __gpio_mask(data->irq - d->gpio_irq);
>
> diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c
> index f30ac9354ff2..3dbc21696924 100644
> --- a/drivers/sh/intc/virq.c
> +++ b/drivers/sh/intc/virq.c
> @@ -87,8 +87,8 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq)
> struct irq_data *data = irq_get_irq_data(irq);
>
> /* scan for duplicates */
> - last = (struct intc_virq_list **)&data->handler_data;
> - for_each_virq(entry, data->handler_data) {
> + last = (struct intc_virq_list **)&data->common->handler_data;
That does not make sense. You convert the one below, but not that one
to the accessor function.
handler_data is a pointer to a struct intc_virq_list. So
struct intc_virq_list **last, *entry, *head;
head = irq_data_get_irq_handler_data(data);
last = &head;
for_each_virq(entry, head) {
....
}
Would be clean code and lets you convert all usage sites of
data->handler_data before actually doing the move to common data.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists