All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] Whitelist function in rule
@ 2020-06-02  9:28 Paul Chaignon
  2020-06-02 10:19 ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Chaignon @ 2020-06-02  9:28 UTC (permalink / raw)
  To: cocci

Hi all,

I'm trying to find calls to ep_tail_call() that are *not* followed by
'return DROP_MISSED_TAIL_CALL'. That works fine (rule1 below), but I then
want to whitelist one specific function, send_drop_notify().

I couldn't find a way to do that from the first rule, so I whitelisted
send_drop_notify() with a second rule (rule2 below). That seems rather
cumbersome and I'm wondering if there's maybe a simpler approach?

  @rule1@
  position p1;
  @@
 
  (
    ep_tail_call(...);
    ... when forall
    return DROP_MISSED_TAIL_CALL;
  |
    ep_tail_call@p1(...);
  )
 
  @rule2@
  position p2, rule1.p1;
  identifier fn != send_drop_notify;
  @@
 
  fn(...) {
  <+...
  ep_tail_call@p1@p2(...);
  ...+>
  }

When I tried using rule1 as the body of the function in rule2, it just
didn't match anything anymore.

Thanks,
Paul
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, other threads:[~2020-06-02 18:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-02  9:28 [Cocci] Whitelist function in rule Paul Chaignon
2020-06-02 10:19 ` Julia Lawall
2020-06-02 12:45   ` Paul Chaignon
2020-06-02 12:55     ` Julia Lawall
2020-06-02 18:57       ` Paul Chaignon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.