All of lore.kernel.org
 help / color / mirror / Atom feed
From: Serge Semin <fancer.lancer@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 14/14] gpio: dwapb: Amend indentation in some cases
Date: Wed, 15 Apr 2020 20:15:16 +0300	[thread overview]
Message-ID: <20200415171516.cugbzhvjua6cygnq@mobilestation> (raw)
In-Reply-To: <20200415141534.31240-15-andriy.shevchenko@linux.intel.com>

On Wed, Apr 15, 2020 at 05:15:34PM +0300, Andy Shevchenko wrote:
> In some cases indentation makes code harder to read. Amend indentation
> in those cases despite of lines go a bit over 80 character limit.
> 
> Cc: Serge Semin <fancer.lancer@gmail.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Tested-by: Serge Semin <fancer.lancer@gmail.com>
> ---
>  drivers/gpio/gpio-dwapb.c | 24 +++++++++---------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index 84c971e0adf0..a09332d9c7fe 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -437,7 +437,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
>  		}
>  	}
>  
> -	for (hwirq = 0 ; hwirq < ngpio ; hwirq++)
> +	for (hwirq = 0; hwirq < ngpio; hwirq++)
>  		irq_create_mapping(gpio->domain, hwirq);
>  
>  	port->gc.to_irq = dwapb_gpio_to_irq;
> @@ -453,7 +453,7 @@ static void dwapb_irq_teardown(struct dwapb_gpio *gpio)
>  	if (!gpio->domain)
>  		return;
>  
> -	for (hwirq = 0 ; hwirq < ngpio ; hwirq++)
> +	for (hwirq = 0; hwirq < ngpio; hwirq++)
>  		irq_dispose_mapping(irq_find_mapping(gpio->domain, hwirq));
>  
>  	irq_domain_remove(gpio->domain);
> @@ -478,10 +478,9 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
>  		return -ENOMEM;
>  #endif
>  
> -	dat = gpio->regs + GPIO_EXT_PORTA + (pp->idx * GPIO_EXT_PORT_STRIDE);
> -	set = gpio->regs + GPIO_SWPORTA_DR + (pp->idx * GPIO_SWPORT_DR_STRIDE);
> -	dirout = gpio->regs + GPIO_SWPORTA_DDR +
> -		(pp->idx * GPIO_SWPORT_DDR_STRIDE);
> +	dat = gpio->regs + GPIO_EXT_PORTA + pp->idx * GPIO_EXT_PORT_STRIDE;
> +	set = gpio->regs + GPIO_SWPORTA_DR + pp->idx * GPIO_SWPORT_DR_STRIDE;
> +	dirout = gpio->regs + GPIO_SWPORTA_DDR + pp->idx * GPIO_SWPORT_DDR_STRIDE;
>  
>  	/* This registers 32 GPIO lines per port */
>  	err = bgpio_init(&port->gc, gpio->dev, 4, dat, set, NULL, dirout,
> @@ -582,17 +581,13 @@ static struct dwapb_platform_data *dwapb_gpio_get_pdata(struct device *dev)
>  
>  		if (fwnode_property_read_u32(fwnode, "reg", &pp->idx) ||
>  		    pp->idx >= DWAPB_MAX_PORTS) {
> -			dev_err(dev,
> -				"missing/invalid port index for port%d\n", i);

> +			dev_err(dev, "missing/invalid port index for port%d\n", i);

What about shortening the message text to fit the 80 chars per line rule?
I suppose the "missing" word could be omitted.

>  			fwnode_handle_put(fwnode);
>  			return ERR_PTR(-EINVAL);
>  		}
>  
> -		if (fwnode_property_read_u32(fwnode, "snps,nr-gpios",
> -					 &pp->ngpio)) {
> -			dev_info(dev,
> -				 "failed to get number of gpios for port%d\n",
> -				 i);
> +		if (fwnode_property_read_u32(fwnode, "snps,nr-gpios", &pp->ngpio)) {

> +			dev_info(dev, "failed to get number of gpios for port%d\n", i);

The same here. For instance "no snps,nr-gpios found for port%d" would work here.

>  			pp->ngpio = 32;
>  		}
>  
> @@ -743,8 +738,7 @@ static int dwapb_gpio_suspend(struct device *dev)
>  			ctx->int_deb	= dwapb_read(gpio, GPIO_PORTA_DEBOUNCE);
>  
>  			/* Mask out interrupts */
> -			dwapb_write(gpio, GPIO_INTMASK,
> -				    0xffffffff & ~ctx->wake_en);

> +			dwapb_write(gpio, GPIO_INTMASK, 0xffffffff & ~ctx->wake_en);

Hm, do I need some rest and missing something or the &-operation with 1s here
does nothing seeing the operands data types have the same width?

(the change introduced by commit 6437c7ba69c3 ("gpio: dwapb: Add wakeup source support"))

-Sergey

>  		}
>  	}
>  	spin_unlock_irqrestore(&gc->bgpio_lock, flags);
> -- 
> 2.25.1
> 

  reply	other threads:[~2020-04-15 17:15 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 14:15 [PATCH v2 00/14] gpio: dwapb: Clean up the driver and a fix Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 01/14] gpio: dwapb: Append MODULE_ALIAS for platform driver Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 02/14] gpio: dwapb: Refactor IRQ handler to use bit operations Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 03/14] gpio: dwapb: Use chained IRQ prologue and epilogue Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 04/14] gpio: dwapb: set default handler to be handle_bad_irq() Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 05/14] gpio: dwapb: Deduplicate IRQ resource management Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 06/14] gpio: dwapb: Convert to use irqd_to_hwirq() Andy Shevchenko
2020-04-15 15:18   ` Serge Semin
2020-04-15 14:15 ` [PATCH v2 07/14] gpio: dwapb: Use device_get_match_data() to simplify code Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 08/14] gpio: dwapb: Convert to use IRQ core provided macros Andy Shevchenko
2020-04-15 17:53   ` Serge Semin
2020-04-16 10:39     ` Andy Shevchenko
2020-04-16 11:01       ` Serge Semin
2020-04-16 12:00         ` Jan Kiszka
2020-04-15 14:15 ` [PATCH v2 09/14] gpio: dwapb: Switch to more usual pattern of RMW in dwapb_gpio_set_debounce() Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 10/14] gpio: dwapb: Drop bogus BUG_ON()s Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 11/14] gpio: dwapb: Drop of_match_ptr() & ACPI_PTR() calls Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 12/14] gpio: dwapb: Split out dwapb_get_irq() helper Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 13/14] gpio: dwapb: Use positive conditional in dwapb_configure_irqs() Andy Shevchenko
2020-04-15 16:37   ` Serge Semin
2020-04-16 11:53     ` Linus Walleij
2020-04-16 13:48       ` Serge Semin
2020-04-17 10:42         ` Linus Walleij
2020-04-17 12:56           ` Andy Shevchenko
2020-04-17 20:53           ` Serge Semin
2020-04-15 14:15 ` [PATCH v2 14/14] gpio: dwapb: Amend indentation in some cases Andy Shevchenko
2020-04-15 17:15   ` Serge Semin [this message]
2020-04-16 10:56     ` Andy Shevchenko
2020-04-16 11:06       ` Serge Semin
2020-04-16 12:14         ` Linus Walleij
2020-04-16 13:37           ` Serge Semin
2020-04-16 13:59             ` Linus Walleij
2020-04-16 14:09             ` Andy Shevchenko
2020-04-16  7:26 ` [PATCH v2 00/14] gpio: dwapb: Clean up the driver and a fix Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200415171516.cugbzhvjua6cygnq@mobilestation \
    --to=fancer.lancer@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.