[cocci] Possible cocci test & that should be |

Joe Perches <[email protected]> Wed, 01 Jul 2026 15:20:16 -0700
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
Hi Julia.

A suggestion for a possible (new?) test.

On Tue, 2026-06-30 at 15:08 -0400, Liam R. Howlett (Oracle) wrote:
> The GFP flags in two tests are obviously incorrect.  Make the tests
> correctly run by updating the GFP flags.
> Link: [https://lore.kernel.org/all/d9cbb89faa5bdb71d451781d214a51ce8923a8=
[email protected]/](https://lore.kernel.org/all/d9cbb89faa5bdb71d451781d=
[email protected]/)
> Reported-by: Joe Perches <[[email protected]](mailto:[email protected])>
[]
> diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/=
maple.c
[]
> @@ -35234,7 +35234,7 @@ static noinline void __init check_prealloc(struct=
 maple_tree *mt)
> -	MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_KERNEL & GFP_NOWAIT) =3D=
=3D 0);
> +	MT_BUG_ON(mt, mas_preallocate(&mas, ptr, GFP_NOWAIT) =3D=3D 0);

Is it possible for cocci to find uses of enums/constants
that are anded together where the result is a likely
unintentional 0 where presumably the & should be an | ?