Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netdevsim: fix ptr_ret.cocci warnings

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

kbuild test robot and committed by
David S. Miller
34611e69 9784e619

+1 -3
+1 -3
drivers/net/netdevsim/dev.c
··· 934 934 int nsim_dev_init(void) 935 935 { 936 936 nsim_dev_ddir = debugfs_create_dir(DRV_NAME, NULL); 937 - if (IS_ERR(nsim_dev_ddir)) 938 - return PTR_ERR(nsim_dev_ddir); 939 - return 0; 937 + return PTR_ERR_OR_ZERO(nsim_dev_ddir); 940 938 } 941 939 942 940 void nsim_dev_exit(void)