On Wed, 23 Aug 2017, Kees Cook wrote:

> I think I'm getting closer. Here are some specific examples that don't
> seem to work:
>
> ---match_callback.cocci---
> virtual patch
>
> @match_timer_function_usage
>  depends on patch@
> expression _E;
> struct timer_list _e;
> identifier _timer;
> identifier _callback;
> type _cast_func, _cast_data;
> @@
>
> (
> -setup_timer(&_E->_timer@_e, _callback, _E);
> |
> -setup_timer(&_E->_timer@_e, &_callback, _E);
> |
> -setup_timer(&_E->_timer@_e, _callback, (_cast_data)_E);
> |
> -setup_timer(&_E->_timer@_e, &_callback, (_cast_data)_E);
> |
> -setup_timer(&_E->_timer@_e, (_cast_func)_callback, _E);
> |
> -setup_timer(&_E->_timer@_e, (_cast_func)&_callback, _E);
> |
> -setup_timer(&_E->_timer@_e, (_cast_func)_callback, (_cast_data)_E);
> |
> -setup_timer(&_E->_timer@_e, (_cast_func)&_callback, (_cast_data)_E);
> |
> -_E->_timer@_e.function = _callback;
> |
> -_E->_timer@_e.function = &_callback;
> |
> -_E->_timer@_e.function = (_cast_func)_callback;
> |
> -_E->_timer@_e.function = (_cast_func)&_callback;
> )
> ---EOF---
>
> Doesn't match drivers/ide/ide-probe.c which has:
>
> setup_timer(&hwif->timer, &ide_timer_expiry, (unsigned long)hwif);
>
> Even this doesn't:
>
> (
> -setup_timer(&_E->_timer@_e, &_callback, (_cast_data)_E);
> )
>
> Unless I remove the "@_e" part...? Am I using that wrong?

For me it works.  Do you have the latest version of Coccinelle from
github?  I used the option --all-includes.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to