All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: nvmem: don't use IS_ERR_OR_NULL
@ 2018-05-20 15:26 Uwe Kleine-König
  2018-05-21 20:35 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2018-05-20 15:26 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, kernel

nvmem_register() never returns NULL, so IS_ERR is good enough here.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Some people don't like IS_ERR_OR_NULL because it is a hint that an API
is badly designed or it it used in a wrong way. In this case it's the
latter. :-)

Best regards
Uwe

 drivers/rtc/nvmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/nvmem.c b/drivers/rtc/nvmem.c
index 17ec4c8d0fad..36ab183c42f1 100644
--- a/drivers/rtc/nvmem.c
+++ b/drivers/rtc/nvmem.c
@@ -94,7 +94,7 @@ int rtc_nvmem_register(struct rtc_device *rtc,
 	nvmem_config->dev = rtc->dev.parent;
 	nvmem_config->owner = rtc->owner;
 	rtc->nvmem = nvmem_register(nvmem_config);
-	if (IS_ERR_OR_NULL(rtc->nvmem))
+	if (IS_ERR(rtc->nvmem))
 		return PTR_ERR(rtc->nvmem);
 
 	/* Register the old ABI */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: nvmem: don't use IS_ERR_OR_NULL
  2018-05-20 15:26 [PATCH] rtc: nvmem: don't use IS_ERR_OR_NULL Uwe Kleine-König
@ 2018-05-21 20:35 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2018-05-21 20:35 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Alessandro Zummo, linux-rtc, kernel

On 20/05/2018 17:26:40+0200, Uwe Kleine-König wrote:
> nvmem_register() never returns NULL, so IS_ERR is good enough here.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Some people don't like IS_ERR_OR_NULL because it is a hint that an API
> is badly designed or it it used in a wrong way. In this case it's the
> latter. :-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-21 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-20 15:26 [PATCH] rtc: nvmem: don't use IS_ERR_OR_NULL Uwe Kleine-König
2018-05-21 20:35 ` Alexandre Belloni

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.