All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>, <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Radu Pirea <radu_nicolae.pirea@upb.ro>,
	Mark Brown <broonie@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Date: Tue, 22 Aug 2023 15:11:01 +0200	[thread overview]
Message-ID: <52e3a5df-41ae-db71-fe4c-f46db22db4c3@microchip.com> (raw)
In-Reply-To: <20230822124643.987079-1-ruanjinjie@huawei.com>

On 22/08/2023 at 14:46, Jinjie Ruan wrote:
> Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
> simplify code.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

Do we really need these changes?... oh well, no strong opinion but is it 
worth the effort?

Regards,
   Nicolas

> ---
>   drivers/spi/spi-at91-usart.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index 75d9bc606442..b11d0f993cc7 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
> 
>          cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
> 
> -       if (IS_ERR(cs_gpios))
> -               return PTR_ERR(cs_gpios);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(cs_gpios);
>   }
> 
>   static int at91_usart_spi_probe(struct platform_device *pdev)
> --
> 2.34.1
> 


WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>, <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Radu Pirea <radu_nicolae.pirea@upb.ro>,
	Mark Brown <broonie@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Date: Tue, 22 Aug 2023 15:11:01 +0200	[thread overview]
Message-ID: <52e3a5df-41ae-db71-fe4c-f46db22db4c3@microchip.com> (raw)
In-Reply-To: <20230822124643.987079-1-ruanjinjie@huawei.com>

On 22/08/2023 at 14:46, Jinjie Ruan wrote:
> Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
> simplify code.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

Do we really need these changes?... oh well, no strong opinion but is it 
worth the effort?

Regards,
   Nicolas

> ---
>   drivers/spi/spi-at91-usart.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index 75d9bc606442..b11d0f993cc7 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
> 
>          cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
> 
> -       if (IS_ERR(cs_gpios))
> -               return PTR_ERR(cs_gpios);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(cs_gpios);
>   }
> 
>   static int at91_usart_spi_probe(struct platform_device *pdev)
> --
> 2.34.1
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-08-22 13:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 12:46 [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
2023-08-22 12:46 ` Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre [this message]
2023-08-22 13:11   ` Nicolas Ferre
2023-08-22 14:15   ` Mark Brown
2023-08-22 14:15     ` Mark Brown
2023-08-22 14:45     ` Alexandre Belloni
2023-08-22 14:45       ` Alexandre Belloni
2023-08-22 15:04       ` Mark Brown
2023-08-22 15:04         ` Mark Brown
2023-08-22 16:33 ` Mark Brown
2023-08-22 16:33   ` Mark Brown

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=52e3a5df-41ae-db71-fe4c-f46db22db4c3@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=radu_nicolae.pirea@upb.ro \
    --cc=ruanjinjie@huawei.com \
    /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.