From patchwork Wed May 20 09:59:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 6444531 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DB64DC0432 for ; Wed, 20 May 2015 10:05:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D333320394 for ; Wed, 20 May 2015 10:05:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 508DD20389 for ; Wed, 20 May 2015 10:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753570AbbETKEI (ORCPT ); Wed, 20 May 2015 06:04:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:34118 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753213AbbETKAX (ORCPT ); Wed, 20 May 2015 06:00:23 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 20 May 2015 03:00:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,464,1427785200"; d="scan'208";a="574172968" Received: from gerry-dev.bj.intel.com ([10.238.158.61]) by orsmga003.jf.intel.com with ESMTP; 20 May 2015 03:00:12 -0700 From: Jiang Liu To: Thomas Gleixner , Bjorn Helgaas , Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Randy Dunlap , Yinghai Lu , Borislav Petkov , Samuel Ortiz , Lee Jones , Tony Lindgren Cc: Jiang Liu , Konrad Rzeszutek Wilk , Tony Luck , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-omap@vger.kernel.org Subject: [RFC v1 08/25] mfd: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc Date: Wed, 20 May 2015 17:59:56 +0800 Message-Id: <1432116013-25902-9-git-send-email-jiang.liu@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432116013-25902-1-git-send-email-jiang.liu@linux.intel.com> References: <1432116013-25902-1-git-send-email-jiang.liu@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we already have a pointer to corresponding irq_desc. Do the same thing to avoid pattern "irq_get_chip_data(data->irq)". Signed-off-by: Jiang Liu Acked-by: Lee Jones --- drivers/mfd/ezx-pcap.c | 2 +- drivers/mfd/max8997-irq.c | 8 ++++---- drivers/mfd/mt6397-core.c | 8 ++++---- drivers/mfd/t7l66xb.c | 2 +- drivers/mfd/tc6393xb.c | 2 +- drivers/mfd/twl6030-irq.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index 5991faddd3c6..e5f4ffaa5414 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -207,7 +207,7 @@ static void pcap_isr_work(struct work_struct *work) static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc) { - struct pcap_chip *pcap = irq_get_handler_data(irq); + struct pcap_chip *pcap = irq_desc_get_handler_data(desc); desc->irq_data.chip->irq_ack(&desc->irq_data); queue_work(pcap->workqueue, &pcap->isr_work); diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c index 43fa61413e93..381738b477f8 100644 --- a/drivers/mfd/max8997-irq.c +++ b/drivers/mfd/max8997-irq.c @@ -113,14 +113,14 @@ static const struct max8997_irq_data max8997_irqs[] = { static void max8997_irq_lock(struct irq_data *data) { - struct max8997_dev *max8997 = irq_get_chip_data(data->irq); + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data); mutex_lock(&max8997->irqlock); } static void max8997_irq_sync_unlock(struct irq_data *data) { - struct max8997_dev *max8997 = irq_get_chip_data(data->irq); + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data); int i; for (i = 0; i < MAX8997_IRQ_GROUP_NR; i++) { @@ -148,7 +148,7 @@ irq_to_max8997_irq(struct max8997_dev *max8997, int irq) static void max8997_irq_mask(struct irq_data *data) { - struct max8997_dev *max8997 = irq_get_chip_data(data->irq); + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data); const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997, data->irq); @@ -157,7 +157,7 @@ static void max8997_irq_mask(struct irq_data *data) static void max8997_irq_unmask(struct irq_data *data) { - struct max8997_dev *max8997 = irq_get_chip_data(data->irq); + struct max8997_dev *max8997 = irq_data_get_irq_chip_data(data); const struct max8997_irq_data *irq_data = irq_to_max8997_irq(max8997, data->irq); diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index 09bc7804952a..dab325b9d0df 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -39,14 +39,14 @@ static const struct mfd_cell mt6397_devs[] = { static void mt6397_irq_lock(struct irq_data *data) { - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); mutex_lock(&mt6397->irqlock); } static void mt6397_irq_sync_unlock(struct irq_data *data) { - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); regmap_write(mt6397->regmap, MT6397_INT_CON0, mt6397->irq_masks_cur[0]); regmap_write(mt6397->regmap, MT6397_INT_CON1, mt6397->irq_masks_cur[1]); @@ -56,7 +56,7 @@ static void mt6397_irq_sync_unlock(struct irq_data *data) static void mt6397_irq_disable(struct irq_data *data) { - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); int shift = data->hwirq & 0xf; int reg = data->hwirq >> 4; @@ -65,7 +65,7 @@ static void mt6397_irq_disable(struct irq_data *data) static void mt6397_irq_enable(struct irq_data *data) { - struct mt6397_chip *mt6397 = irq_get_chip_data(data->irq); + struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(data); int shift = data->hwirq & 0xf; int reg = data->hwirq >> 4; diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index c09fb5dccd50..b752ca2be549 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c @@ -187,7 +187,7 @@ static struct mfd_cell t7l66xb_cells[] = { /* Handle the T7L66XB interrupt mux */ static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc) { - struct t7l66xb *t7l66xb = irq_get_handler_data(irq); + struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc); unsigned int isr; unsigned int i, irq_base; diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index 63458b39a97d..d21253a51cff 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c @@ -525,7 +525,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base) static void tc6393xb_irq(unsigned int irq, struct irq_desc *desc) { - struct tc6393xb *tc6393xb = irq_get_handler_data(irq); + struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc); unsigned int isr; unsigned int i, irq_base; diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index 2807e1a95663..5b8cd5cd42cf 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c @@ -231,7 +231,7 @@ static irqreturn_t twl6030_irq_thread(int irq, void *data) static int twl6030_irq_set_wake(struct irq_data *d, unsigned int on) { - struct twl6030_irq *pdata = irq_get_chip_data(d->irq); + struct twl6030_irq *pdata = irq_data_get_irq_chip_data(d); if (on) atomic_inc(&pdata->wakeirqs);