]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nouveau/gsp: cleanup IS_ERR_OR_NULL in rm_alloc functions
authorHongling Zeng <zenghongling@kylinos.cn>
Thu, 28 May 2026 06:24:47 +0000 (14:24 +0800)
committerLyude Paul <lyude@redhat.com>
Thu, 28 May 2026 16:49:57 +0000 (12:49 -0400)
The underlying functions already return error pointers, so checking for
NULL with IS_ERR_OR_NULL() is redundant. Use IS_ERR() instead.

This affects:
- nvkm_gsp_rm_alloc_get()
- nvkm_gsp_rm_alloc()

Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20260528062451.54107-2-zenghongling@kylinos.cn
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h

index 64fed208e4cf8568805b5294e696d2d4d14104ef..ab2bd88eebce58df705441669d154b9daf959ede 100644 (file)
@@ -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);
 }