• V
    ASoC: wm5102: Use put_unaligned_be16 · a6b3db2c
    Vaishali Thakkar 提交于
    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: NVaishali Thakkar <vthakkar1994@gmail.com>
    Acked-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
    --
    Changes Since v2:
       Make the patch compatible for current code
    
     sound/soc/codecs/wm5102.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    Signed-off-by: NMark Brown <broonie@kernel.org>
    a6b3db2c
wm5102.c 61.0 KB