On 10/10/19 6:00 PM, kbuild test robot wrote:
From: kbuild test robot <lkp(a)intel.com>
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(a)intel.com>
---
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);
Please use tabs instead of spaces for indention.
I've fixes this while sqashing this into the original patch.
}
tnx
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 |
http://www.pengutronix.de |