From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752036AbbGNFjj (ORCPT ); Tue, 14 Jul 2015 01:39:39 -0400 Received: from mga02.intel.com ([134.134.136.20]:24262 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbbGNFji (ORCPT ); Tue, 14 Jul 2015 01:39:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,469,1432623600"; d="scan'208";a="605687601" Message-ID: <55A4A096.2000405@linux.intel.com> Date: Tue, 14 Jul 2015 13:39:34 +0800 From: Jiang Liu Organization: Intel User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ilia Mirkin , Thomas Gleixner CC: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, LKML Subject: Re: [patch 18/19] gpio/msm-v2: Avoid redundant lookup of irq_data References: <20150712232317.244138485@linutronix.de> <20150712232406.260970428@linutronix.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/7/14 13:28, Ilia Mirkin wrote: > > On Jul 13, 2015 4:42 PM, "Thomas Gleixner" > wrote: >> >> It's pretty silly to do >> >> irq_data *d = irq_get_irq_data(irq_data->irq); >> >> because that results in d = irq_data, but goes through a 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-msm-v2.c | 18 +++++------------- >> 1 file changed, 5 insertions(+), 13 deletions(-) >> >> Index: tip/drivers/gpio/gpio-msm-v2.c >> =================================================================== >> --- tip.orig/drivers/gpio/gpio-msm-v2.c >> +++ tip/drivers/gpio/gpio-msm-v2.c >> @@ -187,14 +187,6 @@ static int msm_gpio_to_irq(struct gpio_c >> return irq_create_mapping(domain, offset); >> } >> >> -static inline int msm_irq_to_gpio(struct gpio_chip *chip, unsigned irq) >> -{ >> - struct irq_data *irq_data = irq_get_irq_data(irq); >> - >> - return irq_data->hwirq; >> -} >> - >> - >> /* For dual-edge interrupts in software, since the hardware has no >> * such support: >> * >> @@ -238,7 +230,7 @@ static void msm_gpio_update_dual_edge_po >>w >> static void msm_gpio_irq_ack(struct irq_data *d) >> { >> - int gpio = msm_irq_to_gpio(&msm_gpio.gpio_chip, d->irq); >> + int gpio = d->hw_irq; > > Does this build? It was hwirq above, not hw_irq. Yeah, should be hwirq.