[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200608035859.GB2428291@smile.fi.intel.com>
Date: Mon, 8 Jun 2020 06:58:59 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: kernel test robot <lkp@...el.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
linux-gpio@...r.kernel.org
Subject: Re: [PATCH] pinctrl: mcp23s08: Split to three parts: fix
ptr_ret.cocci warnings
On Mon, Jun 08, 2020 at 09:02:53AM +0800, kernel test robot wrote:
> From: kernel test robot <lkp@...el.com>
>
> 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@...ux.intel.com>
>
> Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI")
> CC: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: kernel test robot <lkp@...el.com>
> ---
>
> 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
Powered by blists - more mailing lists