Re: [PATCH v2] coccinelle: ifaddr: Find address test in more complex conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, 7 Jun 2022, Jérémy LEFAURE wrote:

> The test of an expression's address does not necessarily represent the
> whole condition, it may only be a part of it.
> This change aims at detecting an address test in more complex conditions.
>
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@xxxxxxxxxxx>
> ---
> v1 -> v2: Moved disjunction on the condition itself instead of being on the if statements

Thanks for the change.  It seems to cover all the cases.

julia

>
>  scripts/coccinelle/misc/ifaddr.cocci | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccinelle/misc/ifaddr.cocci b/scripts/coccinelle/misc/ifaddr.cocci
> index fc92e8fcbfcb..14dbf3131a3f 100644
> --- a/scripts/coccinelle/misc/ifaddr.cocci
> +++ b/scripts/coccinelle/misc/ifaddr.cocci
> @@ -18,7 +18,7 @@ statement S1,S2;
>  position p;
>  @@
>
> -*if@p (&x)
> +*if@p ( \(&x || ... \| &x && ... \) )
>   S1 else S2
>
>  @script:python depends on org@
> --
> 2.25.1
>

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux