Re: [Cocci] How to match switch cases and their absence with coccinelle?

2021-01-12 Thread Julia Lawall
On Tue, 12 Jan 2021, Denis Efremov wrote: > > > On 1/12/21 7:13 PM, Julia Lawall wrote: > > > > > > On Tue, 12 Jan 2021, Denis Efremov wrote: > > > >> Hi, > >> > >> Let's suppose I have this pattern: > >> @fix exists@ > >> position p; > >> @@ > >> > >> binder_release_work(...) > >> { > >>

Re: [Cocci] How to match switch cases and their absence with coccinelle?

2021-01-12 Thread Denis Efremov
On 1/12/21 7:13 PM, Julia Lawall wrote: > > > On Tue, 12 Jan 2021, Denis Efremov wrote: > >> Hi, >> >> Let's suppose I have this pattern: >> @fix exists@ >> position p; >> @@ >> >> binder_release_work(...) >> { >> ... >> switch (...) { >> *case BINDER_WORK_NODE: ...

Re: [Cocci] How to match switch cases and their absence with coccinelle?

2021-01-12 Thread Julia Lawall
On Tue, 12 Jan 2021, Denis Efremov wrote: > Hi, > > Let's suppose I have this pattern: > @fix exists@ > position p; > @@ > > binder_release_work(...) > { > ... > switch (...) { > * case BINDER_WORK_NODE: ... break;@p > } > ... Add when any to the outer ...s

[Cocci] How to match switch cases and their absence with coccinelle?

2021-01-12 Thread Denis Efremov
Hi, Let's suppose I have this pattern: @fix exists@ position p; @@ binder_release_work(...) { ... switch (...) { * case BINDER_WORK_NODE: ... break;@p } ... } and I want to match binder_release_work() function in drivers/android/binder.c file (linux