From: Hongling Zeng Date: Thu, 28 May 2026 06:24:49 +0000 (+0800) Subject: nouveau/gsp/rm: cleanup IS_ERR_OR_NULL in core implementation X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67346c90ce275e835e93a4a13041afee47bd3f9e;p=thirdparty%2Fkernel%2Flinux.git nouveau/gsp/rm: cleanup IS_ERR_OR_NULL in core implementation Clean up IS_ERR_OR_NULL() checks in the core RPC and alloc implementation files. The underlying functions return error pointers, so IS_ERR() is sufficient. This affects: - r535_gsp_rpc_rm_free() in alloc.c - r535_gsp_rpc_rm_alloc_push() in alloc.c - r535_gsp_msgq_recv() in rpc.c Signed-off-by: Hongling Zeng Signed-off-by: Lyude Paul Link: https://patch.msgid.link/20260528062451.54107-4-zenghongling@kylinos.cn Reviewed-by: Lyude Paul --- diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/alloc.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/alloc.c index 46e3a29f2ad7f..27f275d2e1510 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/alloc.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/alloc.c @@ -35,7 +35,7 @@ r535_gsp_rpc_rm_free(struct nvkm_gsp_object *object) client->object.handle, object->handle); rpc = nvkm_gsp_rpc_get(gsp, NV_VGPU_MSG_FUNCTION_FREE, sizeof(*rpc)); - if (WARN_ON(IS_ERR_OR_NULL(rpc))) + if (WARN_ON(IS_ERR(rpc))) return -EIO; rpc->params.hRoot = client->object.handle; @@ -60,7 +60,7 @@ r535_gsp_rpc_rm_alloc_push(struct nvkm_gsp_object *object, void *params) void *ret = NULL; rpc = nvkm_gsp_rpc_push(gsp, rpc, NVKM_GSP_RPC_REPLY_RECV, sizeof(*rpc)); - if (IS_ERR_OR_NULL(rpc)) + if (IS_ERR(rpc)) return rpc; if (rpc->status) { diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c index 3ca3de8f43408..41301f19729cf 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/rpc.c @@ -324,7 +324,7 @@ r535_gsp_msgq_recv(struct nvkm_gsp *gsp, u32 gsp_rpc_len, int *retries) u32 size; rpc = r535_gsp_msgq_peek(gsp, sizeof(*rpc), info.retries); - if (IS_ERR_OR_NULL(rpc)) { + if (IS_ERR(rpc)) { kvfree(buf); return rpc; } @@ -333,7 +333,7 @@ r535_gsp_msgq_recv(struct nvkm_gsp *gsp, u32 gsp_rpc_len, int *retries) info.continuation = true; rpc = r535_gsp_msgq_recv_one_elem(gsp, &info); - if (IS_ERR_OR_NULL(rpc)) { + if (IS_ERR(rpc)) { kvfree(buf); return rpc; }