Re: [PATCH 0/5] nouveau/gsp: Cleanup IS_ERR_OR_NULL() usage

From: Timur Tabi

Date: Thu May 28 2026 - 15:26:07 EST


On Thu, 2026-05-28 at 15:09 -0400, lyude@xxxxxxxxxx wrote:
> You are right - I did actually sit down and try to run through all of
> the codepaths for all these functions, but there's clearly a number
> that I missed and should have checked sashiko for.

Even if you could narrow down the list to those functions that are 100% okay with IS_ERR, that's not
future proof. I wouldn't be surprised if there are some code paths where IS_ERR_OR_NULL is
required, but then the NULL is converted to an ERR, and so the top-level caller will see only ERR.
But what happens if there's a refactor or some other major code change?

Like I implied earlier, the real problem is that Nouveau is inconsistent in how it returns failure.
Sometimes it returns NULL, sometimes it returns ERR, sometimes it could be either. So a proper fix
is not replacing IS_ERR_OR_NULL with IS_ERR wherever we can get away with it today. The proper fix
is to revamp the entire code base to be consistent, and no one wants to do that work.