backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Weird problem trying to match code inside a function
@ 2018-09-11  8:08 Luca Coelho
  2018-09-11  9:05 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Coelho @ 2018-09-11  8:08 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cocci, backports, johannes.berg, felipe.balbi

Hi Julia,

I bumped in to another weird problem.  I'm trying to match some code
inside a function that has a specific struct as a parameter, but I
can't get it to work.

This is cocci code I tried first: 

http://pastebin.coelho.fi/6f8f346822a7c99e.txt

And this is the file I'm trying to match:

http://pastebin.coelho.fi/f73f542932add1c6.txt

The led activate op changed from being a function that returns void to
one that returns int and I had to backport that.

The strange thing is that if I have only the first rule, it works fine,
but when I add the second rule it fails.

I can make it work if I match the entire code, without trying to match
the function in the first rule:

http://pastebin.coelho.fi/46c18ce890330d57.txt

And this is fine for me now, but I'm really curious as to why I had the
problem with my first implementation...

Can you shed some light?

--
Cheers,
Luca.

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-11 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11  8:08 Weird problem trying to match code inside a function Luca Coelho
2018-09-11  9:05 ` Julia Lawall
2018-09-11 11:22   ` Luca Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).