Skip to contentSkip to conversation

using "attribute" in - context?

Cocci Johannes Berg 2 participants 3 messages Feb 9, 2017

lore
Share & tools
lore
#0 lore raw

Is there a way to make this work?

@@
identifier fam;
attribute __ro_after_init;
attribute __genl_ro_after_init;
@@
?struct genl_family fam
- __ro_after_init
+ __genl_ro_after_init
?= {...};

Thanks,
johannes

#1 lore raw
Quoted 11 lines · Johannes Berg

Is there a way to make this work?

@@
identifier fam;
attribute __ro_after_init;
attribute __genl_ro_after_init;
@@
?struct genl_family fam
- __ro_after_init
+ __genl_ro_after_init
?= {...};

Not currently, I think. I think that Coccinelle only recognizes attributes on function definitions.

julia

Quoted 9 lines

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

#2 lore raw
Quoted 15 lines · Julia Lawall
Quoted 11 lines · Johannes Berg

Is there a way to make this work?

@@
identifier fam;
attribute __ro_after_init;
attribute __genl_ro_after_init;
@@
?struct genl_family fam
- __ro_after_init
+ __genl_ro_after_init
?= {...};

Quoted 2 lines

Not currently, I think.??I think that Coccinelle only recognizes attributes on function definitions.

Ok, thanks. I'll just define __ro_after_init to nothing then :)

johannes