From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbbG1IGh (ORCPT ); Tue, 28 Jul 2015 04:06:37 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:36410 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755215AbbG1IGR (ORCPT ); Tue, 28 Jul 2015 04:06:17 -0400 Date: Tue, 28 Jul 2015 09:06:13 +0100 From: Lee Jones To: Thomas Gleixner Cc: LKML , Jiang Liu , Samuel Ortiz Subject: Re: [patch 9/9] mfd/max899x: Avoid redundant irq_data lookup Message-ID: <20150728080613.GJ14943@x1> References: <20150712225758.573960291@linutronix.de> <20150712225930.155347885@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150712225930.155347885@linutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) 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: > 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: Lee Jones > Cc: Jiang Liu > Cc: Samuel Ortiz > --- > drivers/mfd/max8997-irq.c | 7 +++---- > drivers/mfd/max8998-irq.c | 9 +++------ > 2 files changed, 6 insertions(+), 10 deletions(-) Applied, thanks. > Index: tip/drivers/mfd/max8997-irq.c > =================================================================== > --- tip.orig/drivers/mfd/max8997-irq.c > +++ tip/drivers/mfd/max8997-irq.c > @@ -140,9 +140,8 @@ static void max8997_irq_sync_unlock(stru > } > > static const inline struct max8997_irq_data * > -irq_to_max8997_irq(struct max8997_dev *max8997, int irq) > +irq_to_max8997_irq(struct max8997_dev *max8997, struct irq_data *data) > { > - struct irq_data *data = irq_get_irq_data(irq); > return &max8997_irqs[data->hwirq]; > } > > @@ -150,7 +149,7 @@ static void max8997_irq_mask(struct 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); > + data); > > max8997->irq_masks_cur[irq_data->group] |= irq_data->mask; > } > @@ -159,7 +158,7 @@ static void max8997_irq_unmask(struct ir > { > 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); > + data); > > max8997->irq_masks_cur[irq_data->group] &= ~irq_data->mask; > } > Index: tip/drivers/mfd/max8998-irq.c > =================================================================== > --- tip.orig/drivers/mfd/max8998-irq.c > +++ tip/drivers/mfd/max8998-irq.c > @@ -98,9 +98,8 @@ static struct max8998_irq_data max8998_i > }; > > static inline struct max8998_irq_data * > -irq_to_max8998_irq(struct max8998_dev *max8998, int irq) > +irq_to_max8998_irq(struct max8998_dev *max8998, struct irq_data *data) > { > - struct irq_data *data = irq_get_irq_data(irq); > return &max8998_irqs[data->hwirq]; > } > > @@ -134,8 +133,7 @@ static void max8998_irq_sync_unlock(stru > static void max8998_irq_unmask(struct irq_data *data) > { > struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); > - struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, > - data->irq); > + struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data); > > max8998->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask; > } > @@ -143,8 +141,7 @@ static void max8998_irq_unmask(struct ir > static void max8998_irq_mask(struct irq_data *data) > { > struct max8998_dev *max8998 = irq_data_get_irq_chip_data(data); > - struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, > - data->irq); > + struct max8998_irq_data *irq_data = irq_to_max8998_irq(max8998, data); > > max8998->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask; > } > > -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog