Yes, the two-rule approach works--that's what I started with.  The ioctl_ref 
rule
is the anchor for a series of six follow-on rules that apply transformations to
ioctl-func decls.   If I have two rules, then I need to replicate the six 
follow-on
rules with trivial modifications, one for each of unlocked_ioctl and 
compat_ioctl.
The unified rule using (...|...) is highly desirable to avoid duplication for 
sake
of development and maintenance.

G

On 09/24/10 08:21, Julia Lawall wrote:
> It doesn't seem to allow disjunctions in structure declaration 
> initializers.  Can you make two rules?  The .X = Y, notation is fine.  You 
> should always put the terminating comma.
>
> julia
>
>
> On Fri, 24 Sep 2010, Greg McGary wrote:
>
> >  Any clues about this?
> > 
> > Consider this:
> > 
> > @ ioctl_ref @
> > identifier fops_id;
> > identifier ioctl_id;
> > @@
> > struct file_operations fops_id  = {
> >     ...
> > (
> >     .unlocked_ioctl
> > |
> >     .compat_ioctl
> > )
> >     = ioctl_id,
> >     ...
> > };
> > 
>

_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to