From: kernel test robot <lkp@xxxxxxxxx> 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@xxxxxxxxxx> Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: kernel test robot <lkp@xxxxxxxxx> --- 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);