Re: [cocci] [RFC] Coccinelle: Use IS_ERR_OR_NULL

Markus Elfring <[email protected]> Fri, 6 Mar 2026 08:15:58 +0100
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
…
> +@p1 depends on patch@
> +expression E;
> +@@
> +(
> +-	E != NULL && !IS_ERR(E)
> ++	!IS_ERR_OR_NULL(E)
> +|
> +-	E == NULL || IS_ERR(E)
> ++	!IS_ERR_OR_NULL(E)
> +|
> +-	!IS_ERR(E) && E != NULL
> ++	IS_ERR_OR_NULL(E)
> +|
> +-	IS_ERR(E) || E == NULL
> ++	IS_ERR_OR_NULL(E)
> +)
…

I find such case distinctions questionable.
Thus I suggest to clarify presented implementation details in more detail
also for better source code transformation approaches.

Regards,
Markus