From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755025AbbGNKQv (ORCPT ); Tue, 14 Jul 2015 06:16:51 -0400 Received: from www.linutronix.de ([62.245.132.108]:59321 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753642AbbGNKQt (ORCPT ); Tue, 14 Jul 2015 06:16:49 -0400 Date: Tue, 14 Jul 2015 12:16:40 +0200 (CEST) From: Thomas Gleixner To: LKML cc: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, Jiang Liu Subject: Re: [patch 19/19] gpio/davinci: Avoid redundant lookup of irq_data In-Reply-To: <20150712232406.341044190@linutronix.de> Message-ID: References: <20150712232317.244138485@linutronix.de> <20150712232406.341044190@linutronix.de> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jul 2015, Thomas Gleixner wrote: > - g = (__force struct davinci_gpio_regs __iomem *)irq_get_chip_data(irq); > + g = (__force struct davinci_gpio_regs __iomem *)irq_data_get_chip_data(d); Too tired to use the proper function AND enable the Kconfig switch to compile it actually. Updated patch below. git branch irq/gpio is updated as well. Thanks, tglx ---------------> Subject: gpio/davinci: Avoid redundant lookup of irq_data From: Thomas Gleixner Date: Mon, 13 Jul 2015 01:18:56 +0200 It's pretty silly to do void *cd = irq_get_chip_data(irq_data->irq); because that results in cd = irq_data->chip_data, but goes through a redundant lookup of the irq_data. Use irq_data directly. Signed-off-by: Thomas Gleixner Cc: Linus Walleij Cc: Alexandre Courbot Cc: Jiang Liu Cc: linux-gpio@vger.kernel.org --- drivers/gpio/gpio-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Signed-off-by: Thomas Gleixner --- drivers/gpio/gpio-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: tip/drivers/gpio/gpio-davinci.c =================================================================== --- tip.orig/drivers/gpio/gpio-davinci.c +++ tip/drivers/gpio/gpio-davinci.c @@ -65,11 +65,11 @@ static struct davinci_gpio_regs __iomem return ptr; } -static inline struct davinci_gpio_regs __iomem *irq2regs(int irq) +static inline struct davinci_gpio_regs __iomem *irq2regs(struct irq_data *d) { struct davinci_gpio_regs __iomem *g; - g = (__force struct davinci_gpio_regs __iomem *)irq_get_chip_data(irq); + g = (__force struct davinci_gpio_regs __iomem *)irq_data_get_irq_chip_data(d); return g; } @@ -287,7 +287,7 @@ static int davinci_gpio_probe(struct pla static void gpio_irq_disable(struct irq_data *d) { - struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); + struct davinci_gpio_regs __iomem *g = irq2regs(d); u32 mask = (u32) irq_data_get_irq_handler_data(d); writel_relaxed(mask, &g->clr_falling); @@ -296,7 +296,7 @@ static void gpio_irq_disable(struct irq_ static void gpio_irq_enable(struct irq_data *d) { - struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); + struct davinci_gpio_regs __iomem *g = irq2regs(d); u32 mask = (u32) irq_data_get_irq_handler_data(d); unsigned status = irqd_get_trigger_type(d);