mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2020-06-08  1:02 kernel test robot
  2020-06-08  1:02 ` [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings kernel test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-06-08  1:02 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: kbuild-all, linux-kernel, Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

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
date:   8 weeks ago
config: parisc-randconfig-c021-20200607 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26441 bytes --]

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

* [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings
  2020-06-08  1:02 drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
@ 2020-06-08  1:02 ` kernel test robot
  2020-06-08  3:58   ` Andy Shevchenko
  2020-06-10 11:09   ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2020-06-08  1:02 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: kbuild-all, linux-kernel, Linus Walleij, linux-gpio

From: kernel test robot <lkp@intel.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

Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI")
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: kernel test robot <lkp@intel.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)

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

* Re: [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings
  2020-06-08  1:02 ` [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings kernel test robot
@ 2020-06-08  3:58   ` Andy Shevchenko
  2020-06-10 11:09   ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-06-08  3:58 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel, Linus Walleij, linux-gpio

On Mon, Jun 08, 2020 at 09:02:53AM +0800, kernel test robot wrote:
> From: kernel test robot <lkp@intel.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@linux.intel.com>

> 
> Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I²C, SPI")
> CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: kernel test robot <lkp@intel.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



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

* Re: [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings
  2020-06-08  1:02 ` [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings kernel test robot
  2020-06-08  3:58   ` Andy Shevchenko
@ 2020-06-10 11:09   ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2020-06-10 11:09 UTC (permalink / raw)
  To: kernel test robot
  Cc: Andy Shevchenko, kbuild-all, linux-kernel, open list:GPIO SUBSYSTEM

On Mon, Jun 8, 2020 at 3:03 AM kernel test robot <lkp@intel.com> wrote:

> From: kernel test robot <lkp@intel.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
>
> Fixes: 0f04a81784fe ("pinctrl: mcp23s08: Split to three parts: core, I涎, SPI")
> CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>

Patch applied with Andy's ACK.

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-06-10 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08  1:02 drivers/pinctrl/pinctrl-mcp23s08_spi.c:129:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-06-08  1:02 ` [PATCH] pinctrl: mcp23s08: Split to three parts: fix ptr_ret.cocci warnings kernel test robot
2020-06-08  3:58   ` Andy Shevchenko
2020-06-10 11:09   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®