The github version of Coccinelle finally supports the semantic patch for your code. I have attached the semantic patch. I wonder what should be done with this? Do you want to use it locally with make coccicheck? Do you want it to be integrated into the kernel? Everything in the semantic patch depends on the occurrence of BQ27XXX_DATA, so if make coccicheck is used on files that don't contain this word, they should be ignored very efficiently. So perhaps it is ok for scripts/coccinelle even if it is relevant to only one file. julia