[PATCH] can: mcp25xxfd: fix ptr_ret.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: kbuild test robot <lkp@xxxxxxxxx>

drivers/net/can/spi/mcp25xxfd/mcp25xxfd_regmap.c:93:8-10: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 7de255ffe2cc ("can: mcp25xxfd: add regmap infrastructure")
Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git mcp25xxfd
head:   fc940214e54b37f338dc9e308cd6501b96fcdb0a
commit: 7de255ffe2cc75da3518d110717ca5ef0bf5073f [42/57] can: mcp25xxfd: add regmap infrastructure

 mcp25xxfd_regmap.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_regmap.c
+++ b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_regmap.c
@@ -90,8 +90,5 @@ int mcp25xxfd_regmap_init(struct mcp25xx
 {
 	priv->map = devm_regmap_init(&priv->spi->dev, &mcp25xxfd_bus,
 					priv, &mcp25xxfd_regmap);
-        if (IS_ERR(priv->map))
-                return PTR_ERR(priv->map);
-
-	return 0;
+        return PTR_ERR_OR_ZERO(priv->map);
 }



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux