Re: [PATCH 0/5] Revert cleanups for IS_ERR_OR_NULL() usage
From: Danilo Krummrich
Date: Thu May 28 2026 - 15:47:55 EST
On Thu May 28, 2026 at 9:27 PM CEST, Lyude Paul wrote:
> Lyude Paul (5):
> Revert "nouveau/gsp/rm: cleanup remaining IS_ERR_OR_NULL usage"
> Revert "nouveau/gsp/rm: cleanup IS_ERR_OR_NULL in core implementation"
> Revert "nouveau/gsp/rm: cleanup WARN_ON(IS_ERR_OR_NULL)"
> Revert "nouveau/gsp: cleanup IS_ERR_OR_NULL in rpc_rd"
> Revert "nouveau/gsp: cleanup IS_ERR_OR_NULL in rm_alloc functions"
Reverting the whole thing for now is the right call, as it needs some more
review.
@Timur: I do think cleaning this up is the right call in general though, and I
also don't think that the whole driver necessarily needs to be consistent on
whether IS_ERR_OR_NULL() or IS_ERR() is used -- it depends on the context
(although I usually prefer not to mix up NULL and ERR semantics in the first
place).
It should however be consistent in terms of what functions can actually return.
ret = foo();
if (IS_ERR_OR_NULL(ret))
return ret;
If foo() can never return NULL, the above is misleading, as it puts an
obligation on the caller to somehow handle the NULL case and come up with an
actual error code for it.
So, I think it is the right call to align that to what functions can actually
return, but while doing this, the contract should be properly documented, such
that subsequent changes can be properly validated.
I can pick this up later, but in case you want to pick it up Lyude, note that
this now has to go into drm-misc-next-fixes.
Thanks,
Danilo