nfp: Convert to use ERR_CAST()
authorShen Lichuan <shenlichuan@vivo.com>
Thu, 29 Aug 2024 07:25:38 +0000 (15:25 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Aug 2024 18:11:00 +0000 (11:11 -0700)
Use ERR_CAST() as it is designed for casting an error pointer to
another type.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://patch.msgid.link/20240829072538.33195-1-shenlichuan@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c

index 7136bc4..df0234a 100644 (file)
@@ -278,7 +278,7 @@ struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp)
 
        res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
        if (IS_ERR(res))
-               return (void *)res;
+               return ERR_CAST(res);
 
        state = kzalloc(sizeof(*state), GFP_KERNEL);
        if (!state) {