[PATCH] net: fix err_cast.cocci warnings

kernel test robot
2021-04-02T18:03:45Z

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

drivers/net/wwan/wwan_core.c:208:9-16: WARNING: ERR_CAST can be used with wwandev

Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

CC: Loic Poulain <loic.poulain@linaro.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

url: https://github.com/0day-ci/linux/commits/Loic-Poulain/net-Add-a-WWAN-subsystem/20210402-220002
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git bd78980be1a68d14524c51c4b4170782fada622b

wwan_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -205,7 +205,7 @@ struct wwan_port *wwan_create_port(struc
*/
wwandev = wwan_create_dev(parent);
if (IS_ERR(wwandev))
- return ERR_PTR(PTR_ERR(wwandev));
+ return ERR_CAST(wwandev);

/* A port is exposed as character device, get a minor */
minor = ida_alloc_range(&minors, 0, WWAN_MAX_MINORS - 1, GFP_KERNEL);