On Mon, Jun 08, 2020 at 09:02:53AM +0800, kernel test robot wrote: > From: kernel test robot <lkp@xxxxxxxxx> > > drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: 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 Makes sense. Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > > Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI") > CC: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > Signed-off-by: kernel test robot <lkp@xxxxxxxxx> > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: cf0c97f148e9e50aa5a7ddd1984a604dd2bde4af > commit: 0f04a81784fe3ddc00cae74c517265b3ddb8825c pinctrl: mcp23s08: Split to three parts: core, I²C, SPI > > pinctrl-mcp23s08_spi.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > --- a/drivers/pinctrl/pinctrl-mcp23s08_spi.c > +++ b/drivers/pinctrl/pinctrl-mcp23s08_spi.c > @@ -126,10 +126,7 @@ static int mcp23s08_spi_regmap_init(stru > copy->name = name; > > mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp, copy); > - if (IS_ERR(mcp->regmap)) > - return PTR_ERR(mcp->regmap); > - > - return 0; > + return PTR_ERR_OR_ZERO(mcp->regmap); > } > > static int mcp23s08_probe(struct spi_device *spi) -- With Best Regards, Andy Shevchenko