[PATCH 4/7] nouveau/gsp: cleanup IS_ERR_OR_NULL in rm_alloc functions

From: Hongling Zeng

Date: Fri May 29 2026 - 00:45:07 EST


The underlying functions already return error pointers, so checking for
NULL with IS_ERR_OR_NULL() is redundant. Use IS_ERR() instead.

The underlying gsp->rm->api->alloc->get() function is documented to return
error pointers only, never NULL (as per kernel-doc comment added in
previous patch).

This affects:
- nvkm_gsp_rm_alloc_get()
- nvkm_gsp_rm_alloc()

Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
---
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
index a061779e0107..d771134fa410 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h
@@ -373,7 +373,7 @@ nvkm_gsp_rm_alloc_get(struct nvkm_gsp_object *parent, u32 handle, u32 oclass, u3
object->handle = handle;

argv = gsp->rm->api->alloc->get(object, oclass, argc);
- if (IS_ERR_OR_NULL(argv)) {
+ if (IS_ERR(argv)) {
object->client = NULL;
return argv;
}
@@ -415,8 +415,8 @@ nvkm_gsp_rm_alloc(struct nvkm_gsp_object *parent, u32 handle, u32 oclass, u32 ar
{
void *argv = nvkm_gsp_rm_alloc_get(parent, handle, oclass, argc, object);

- if (IS_ERR_OR_NULL(argv))
- return argv ? PTR_ERR(argv) : -EIO;
+ if (IS_ERR(argv))
+ return PTR_ERR(argv);

return nvkm_gsp_rm_alloc_wr(object, argv);
}
--
2.25.1