netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net:master 40/48] drivers/net/netdevsim/dev.c:937:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2020-02-04 14:21 kbuild test robot
  2020-02-04 14:22 ` [PATCH] netdevsim: fix ptr_ret.cocci warnings kbuild test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2020-02-04 14:21 UTC (permalink / raw)
  To: Taehee Yoo; +Cc: kbuild-all, netdev, Jakub Kicinski

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   83b43045308ea0600099830292955f18818f8d5e
commit: 6556ff32f12d0a5380dd2fa6bbaa01373925a7d1 [40/48] netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs

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


coccinelle warnings: (new ones prefixed by >>)

>> drivers/net/netdevsim/dev.c:937:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

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

* [PATCH] netdevsim: fix ptr_ret.cocci warnings
  2020-02-04 14:21 [net:master 40/48] drivers/net/netdevsim/dev.c:937:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
@ 2020-02-04 14:22 ` kbuild test robot
  2020-02-05 12:56   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2020-02-04 14:22 UTC (permalink / raw)
  To: Taehee Yoo; +Cc: kbuild-all, netdev, Jakub Kicinski, linux-kernel

From: kbuild test robot <lkp@intel.com>

drivers/net/netdevsim/dev.c:937: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: 6556ff32f12d ("netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs")
CC: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   83b43045308ea0600099830292955f18818f8d5e
commit: 6556ff32f12d0a5380dd2fa6bbaa01373925a7d1 [40/48] netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs

 dev.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -934,9 +934,7 @@ int nsim_dev_port_del(struct nsim_bus_de
 int nsim_dev_init(void)
 {
 	nsim_dev_ddir = debugfs_create_dir(DRV_NAME, NULL);
-	if (IS_ERR(nsim_dev_ddir))
-		return PTR_ERR(nsim_dev_ddir);
-	return 0;
+	return PTR_ERR_OR_ZERO(nsim_dev_ddir);
 }
 
 void nsim_dev_exit(void)

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

* Re: [PATCH] netdevsim: fix ptr_ret.cocci warnings
  2020-02-04 14:22 ` [PATCH] netdevsim: fix ptr_ret.cocci warnings kbuild test robot
@ 2020-02-05 12:56   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-05 12:56 UTC (permalink / raw)
  To: lkp; +Cc: ap420073, kbuild-all, netdev, kuba, linux-kernel

From: kbuild test robot <lkp@intel.com>
Date: Tue, 4 Feb 2020 22:22:02 +0800

> From: kbuild test robot <lkp@intel.com>
> 
> drivers/net/netdevsim/dev.c:937: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: 6556ff32f12d ("netdevsim: use IS_ERR instead of IS_ERR_OR_NULL for debugfs")
> CC: Taehee Yoo <ap420073@gmail.com>
> Signed-off-by: kbuild test robot <lkp@intel.com>

Applied, thank you.

For some reason the patches posted by the kbuild robot never reach it to
the mailing list and therefore never make it into patchwork.

Which means I have to process these by hand which is more work and error
prone.

I'll try to watch vger's mail system for why this may be happening but
if you see any bounce notificiations or info on your end please let me
know.

Thank you.

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

* [PATCH] netdevsim: fix ptr_ret.cocci warnings
  2019-08-12 10:16 [patch net-next] netdevsim: implement support for devlink region and snapshots Jiri Pirko
@ 2019-08-13  1:14 ` kbuild test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2019-08-13  1:14 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: kbuild-all, netdev, davem, jakub.kicinski, mlxsw

From: kbuild test robot <lkp@intel.com>

drivers/net/netdevsim/dev.c:297: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: e9cf98183f96 ("netdevsim: implement support for devlink region and snapshots")
CC: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Jiri-Pirko/netdevsim-implement-support-for-devlink-region-and-snapshots/20190813-002135

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

--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -294,10 +294,7 @@ static int nsim_dev_dummy_region_init(st
 		devlink_region_create(devlink, "dummy",
 				      NSIM_DEV_DUMMY_REGION_SNAPSHOT_MAX,
 				      NSIM_DEV_DUMMY_REGION_SIZE);
-	if (IS_ERR(nsim_dev->dummy_region))
-		return PTR_ERR(nsim_dev->dummy_region);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(nsim_dev->dummy_region);
 }
 
 static void nsim_dev_dummy_region_exit(struct nsim_dev *nsim_dev)

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

end of thread, other threads:[~2020-02-05 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 14:21 [net:master 40/48] drivers/net/netdevsim/dev.c:937:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2020-02-04 14:22 ` [PATCH] netdevsim: fix ptr_ret.cocci warnings kbuild test robot
2020-02-05 12:56   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-08-12 10:16 [patch net-next] netdevsim: implement support for devlink region and snapshots Jiri Pirko
2019-08-13  1:14 ` [PATCH] netdevsim: fix ptr_ret.cocci warnings kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).