[alsa-devel] [PATCH] ASoC: wm5102: Use put_unaligned_be16

Vaishali Thakkar vthakkar1994 at gmail.com
Wed Jan 7 16:24:58 CET 2015


On Wed, Jan 7, 2015 at 3:31 PM, Charles Keepax
<ckeepax at opensource.wolfsonmicro.com> wrote:
> On Fri, Dec 26, 2014 at 10:14:57AM +0530, Vaishali Thakkar wrote:
>> This patch introduces the use of function put_unaligned_be16.
>>
>> This is done using Coccinelle and semantic patch used is as follows:
>>
>> @a@
>> typedef u16, __be16, uint16_t;
>> {u16,__be16,uint16_t} e16;
>> identifier tmp;
>> expression ptr;
>> expression y,e;
>> type T;
>> @@
>>
>> - tmp = cpu_to_be16(y);
>>
>> <+... when != tmp
>> (
>> - memcpy(ptr, (T)&tmp, \(2\|sizeof(u16)\|sizeof(__be16)\|sizeof(uint16_t)\|sizeof(e16)\));
>> + put_unaligned_be16(y,ptr);
>> |
>> - memcpy(ptr, (T)&tmp, ...);
>> + put_unaligned_be16(y,ptr);
>> )
>> ...+>
>> ? tmp = e
>>
>> @@ type T; identifier a.tmp; @@
>>
>> - T tmp;
>> ...when != tmp
>>
>> Signed-off-by: Vaishali Thakkar <vthakkar1994 at gmail.com>
>> ---
>
> Acked-by: Charles Keepax <ckeepax at opensource.wolfsonmicro.com>
>
> CCing patches at opensource.wolfsonmicro.com would be handy though.

Ok. Will keep this in mind while sending patches of audio drivers.

Do I need to send this patch again with CC??

> Thanks,
> Charles



-- 
Vaishali


More information about the Alsa-devel mailing list