[Cocci] Finding a field in a structure

Julia Lawall julia at diku.dk
Wed Mar 31 21:55:55 CEST 2010


On Wed, 31 Mar 2010, Frederic Weisbecker wrote:

> Hi,
> 
> I'm trying to fetch all declarations of a variable of a given
> type and patch one of its field assignment.
> 
> In this particular case, I want to do this:
> 
> struct file_operations foo = {
> 	.....
> -	.ioctl = blah,
> +	.unlocked_ioctl = blah,
> 	.....
> };

Make the script as above, but with just three dots each time, instead of 
five.

Coccinelle should manage the presence or absence of , so it should be ok 
even if .ioctl is at the end of the list and doesn't have a comma after 
it.

julia


More information about the Cocci mailing list