From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 92BFD1CF1CA for ; Wed, 16 May 2018 09:12:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8FFD685DA7 for ; Wed, 16 May 2018 09:12:06 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CGhNmS+hGQoB for ; Wed, 16 May 2018 09:12:04 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 363A185D47 for ; Wed, 16 May 2018 09:12:04 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id h5-v6so70805wrm.4 for ; Wed, 16 May 2018 02:12:04 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH v3 10/11] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number Date: Wed, 16 May 2018 11:11:49 +0200 Message-Id: <1526461910-20650-11-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1526461910-20650-1-git-send-email-sergio.paracuellos@gmail.com> References: <1526461910-20650-1-git-send-email-sergio.paracuellos@gmail.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org There are some places where magic number '32' is being used to get the gpio bank. There already exist a definition MTK_BANK_WIDTH with this value, so just use it instead. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index 9fcdaf4..0b403f9 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c @@ -229,7 +229,7 @@ mediatek_gpio_irq_unmask(struct irq_data *d) struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct mtk_data *gpio_data = gpiochip_get_data(gc); int pin = d->hwirq; - int bank = pin / 32; + int bank = pin / MTK_BANK_WIDTH; struct mtk_gc *rg = gpio_data->gc_map[bank]; unsigned long flags; u32 rise, fall; @@ -252,7 +252,7 @@ mediatek_gpio_irq_mask(struct irq_data *d) struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct mtk_data *gpio_data = gpiochip_get_data(gc); int pin = d->hwirq; - int bank = pin / 32; + int bank = pin / MTK_BANK_WIDTH; struct mtk_gc *rg = gpio_data->gc_map[bank]; unsigned long flags; u32 rise, fall; @@ -275,7 +275,7 @@ mediatek_gpio_irq_type(struct irq_data *d, unsigned int type) struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct mtk_data *gpio_data = gpiochip_get_data(gc); int pin = d->hwirq; - int bank = pin / 32; + int bank = pin / MTK_BANK_WIDTH; struct mtk_gc *rg = gpio_data->gc_map[bank]; u32 mask = BIT(d->hwirq); -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel