* [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
@ 2023-08-22 12:46 Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre
2023-08-22 16:33 ` Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-22 12:46 UTC (permalink / raw)
To: linux-spi, linux-arm-kernel, Radu Pirea, Mark Brown,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea
Cc: ruanjinjie
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
2023-08-22 12:46 [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
@ 2023-08-22 13:11 ` Nicolas Ferre
2023-08-22 14:15 ` Mark Brown
2023-08-22 16:33 ` Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Ferre @ 2023-08-22 13:11 UTC (permalink / raw)
To: Jinjie Ruan, linux-spi, linux-arm-kernel, Radu Pirea, Mark Brown,
Alexandre Belloni, Claudiu Beznea
Cc: Russell King - ARM Linux
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
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
2023-08-22 13:11 ` Nicolas Ferre
@ 2023-08-22 14:15 ` Mark Brown
2023-08-22 14:45 ` Alexandre Belloni
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2023-08-22 14:15 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Jinjie Ruan, linux-spi, linux-arm-kernel, Radu Pirea,
Alexandre Belloni, Claudiu Beznea, Russell King - ARM Linux
[-- Attachment #1: Type: text/plain, Size: 316 bytes --]
On Tue, Aug 22, 2023 at 03:11:01PM +0200, Nicolas Ferre wrote:
> Do we really need these changes?... oh well, no strong opinion but is it
> worth the effort?
I tend to go on the basis that for this sort of thing that's recognised
by pattern matching other people will end up sending versions of it no
matter what.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
2023-08-22 14:15 ` Mark Brown
@ 2023-08-22 14:45 ` Alexandre Belloni
2023-08-22 15:04 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2023-08-22 14:45 UTC (permalink / raw)
To: Mark Brown
Cc: Nicolas Ferre, Jinjie Ruan, linux-spi, linux-arm-kernel,
Radu Pirea, Claudiu Beznea, Russell King - ARM Linux
On 22/08/2023 15:15:13+0100, Mark Brown wrote:
> On Tue, Aug 22, 2023 at 03:11:01PM +0200, Nicolas Ferre wrote:
>
> > Do we really need these changes?... oh well, no strong opinion but is it
> > worth the effort?
>
> I tend to go on the basis that for this sort of thing that's recognised
> by pattern matching other people will end up sending versions of it no
> matter what.
And I'd love for people to explicitly write this has been automatically
generated in their commit log so we know that probably no though has
been given to the patch.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
2023-08-22 14:45 ` Alexandre Belloni
@ 2023-08-22 15:04 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2023-08-22 15:04 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Nicolas Ferre, Jinjie Ruan, linux-spi, linux-arm-kernel,
Radu Pirea, Claudiu Beznea, Russell King - ARM Linux
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
On Tue, Aug 22, 2023 at 04:45:55PM +0200, Alexandre Belloni wrote:
> On 22/08/2023 15:15:13+0100, Mark Brown wrote:
> > I tend to go on the basis that for this sort of thing that's recognised
> > by pattern matching other people will end up sending versions of it no
> > matter what.
> And I'd love for people to explicitly write this has been automatically
> generated in their commit log so we know that probably no though has
> been given to the patch.
Well, a bunch of them are going to be manually written by someone based
on fixing warnings that some checker is generating rather than actually
automatically generated.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
2023-08-22 12:46 [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre
@ 2023-08-22 16:33 ` Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2023-08-22 16:33 UTC (permalink / raw)
To: linux-spi, linux-arm-kernel, Radu Pirea, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Jinjie Ruan
On Tue, 22 Aug 2023 20:46:42 +0800, Jinjie Ruan wrote:
> Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
> simplify code.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
commit: 60ea3db33fbddf559e18567ca8897f6bb9f25290
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-22 16:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 12:46 [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre
2023-08-22 14:15 ` Mark Brown
2023-08-22 14:45 ` Alexandre Belloni
2023-08-22 15:04 ` Mark Brown
2023-08-22 16:33 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).