From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5D7441CF1BD for ; Wed, 16 May 2018 05:30:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5AF3086CE8 for ; Wed, 16 May 2018 05:30:19 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3GDwPAQ3NeG2 for ; Wed, 16 May 2018 05:30:19 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by hemlock.osuosl.org (Postfix) with ESMTPS id B9C7086A43 for ; Wed, 16 May 2018 05:30:18 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id y15-v6so2315577wrg.11 for ; Tue, 15 May 2018 22:30:18 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH v2 10/11] staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number Date: Wed, 16 May 2018 07:30:03 +0200 Message-Id: <1526448604-3533-11-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1526448604-3533-1-git-send-email-sergio.paracuellos@gmail.com> References: <1526448604-3533-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 379efc4..9124c1d 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