target/mips: Simplify decode_opc_mxu() ifdef'ry
[qemu/ar7.git] / scripts / coccinelle / inplace-byteswaps.cocci
bloba869a90cbfd717e79753fbdfb9fdf1d147bc4d8f
1 // Replace uses of in-place byteswapping functions with calls to the
2 // equivalent not-in-place functions.  This is necessary to avoid
3 // undefined behaviour if the expression being swapped is a field in a
4 // packed struct.
6 @@
7 expression E;
8 @@
9 -be16_to_cpus(&E);
10 +E = be16_to_cpu(E);
12 expression E;
14 -be32_to_cpus(&E);
15 +E = be32_to_cpu(E);
17 expression E;
19 -be64_to_cpus(&E);
20 +E = be64_to_cpu(E);
22 expression E;
24 -cpu_to_be16s(&E);
25 +E = cpu_to_be16(E);
27 expression E;
29 -cpu_to_be32s(&E);
30 +E = cpu_to_be32(E);
32 expression E;
34 -cpu_to_be64s(&E);
35 +E = cpu_to_be64(E);
37 expression E;
39 -le16_to_cpus(&E);
40 +E = le16_to_cpu(E);
42 expression E;
44 -le32_to_cpus(&E);
45 +E = le32_to_cpu(E);
47 expression E;
49 -le64_to_cpus(&E);
50 +E = le64_to_cpu(E);
52 expression E;
54 -cpu_to_le16s(&E);
55 +E = cpu_to_le16(E);
57 expression E;
59 -cpu_to_le32s(&E);
60 +E = cpu_to_le32(E);
62 expression E;
64 -cpu_to_le64s(&E);
65 +E = cpu_to_le64(E);