On Sat, Sep 15, 2012 at 12:38 PM, Julia Lawall <[email protected]> wrote:
> On Sat, 15 Sep 2012, Shubhrajyoti Datta wrote:
>
>> Hi ,
>>
>> Currently the i2c core returns a negative number in case of errors.
>> I am trying to add support for i2c core to report the number of bytes.
>> This calls for adding a field to the i2c struct.
>>
>>
>> So the other callers need to be converted to C99 first like [1].
>> The issue is that there are many others also [2].
>>
>> My question is that is there a way to automate the conversion.
>
>
> Thank you for your interest in Coccinelle.  It seems a little bit
> complicated, but very useful.  I'll try to get back to you with a suggestion
> shortly.

Thanks for the reply.

>  It may not be possible to do the translation in its full
> generality, because Coccinelle is not so good a managing nested structures.
Since in my case there are a large no of instances. Automating the
non-nested ones like

drivers/rtc/rtc-rs5c372.c
106         struct i2c_msg          msgs[] = {
107                 { client->addr, I2C_M_RD, sizeof rs5c->buf, rs5c->buf },
108         };


> Is it common to have an array of structures, like in your example?
Yes it is.
However the one with only one like the above is also there.

>
> julia
>
>
>>
>> Any help would be appreciated.
>>
>> With Regards,
>> Shubhro
>>
>>
>>
>> [1] - http://www.mail-archive.com/[email protected]/msg09432.html
>> [2] - http://www.mail-archive.com/[email protected]/msg08972.html
>> _______________________________________________
>> Cocci mailing list
>> [email protected]
>> http://lists.diku.dk/mailman/listinfo/cocci
>> (Web access from inside DIKUs LAN only)
>>
>
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to