1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /* Semantic patch for fspupdvpd_sanitize.sh. Please call the script directly. */
10 * Convert named typedef'd structs
11 * Example : typedef struct name {} name_t; -> struct name {};
17 typedef struct i { ... } t;
19 /* Make typename usable as identifier */
20 @ script:python named_struct_type @
24 coccinelle.i = t.rstrip('_t')
26 @ convert_FSP_UPD_HEADER @
27 typedef FSP_UPD_HEADER;
30 + struct FSP_UPD_HEADER
32 @ convert_FSPM_ARCH_UPD @
33 typedef FSPM_ARCH_UPD;
36 + struct FSPM_ARCH_UPD
38 @ convert_named_struct_decls @
40 identifier named_struct_type.i;
50 /* Replace type with struct */
51 @ named_typedef_to_struct @
53 identifier named_struct_type.i;
60 * Convert unnamed typedef'd structs
61 * Example : typedef struct {} name_t; -> struct name {};
66 typedef struct { ... } t;
68 /* Make typename usable as identifier */
69 @ script:python unnamed_struct_type @
70 t << unnamed_struct.t;
73 coccinelle.i = t.rstrip('_t')
75 @ convert_unnamed_struct_decls @
76 type unnamed_struct.t;
77 identifier unnamed_struct_type.i;
87 * Convert unnamed typedef'd enums
92 typedef enum { ... } t;
94 /* Make typename usable as identifier */
95 @ script:python unnamed_enum_type @
99 coccinelle.i = t.rstrip('_t')
101 @ convert_unnamed_enum_decls @
103 identifier unnamed_enum_type.i;
112 /* Replace type with struct */
113 @ unnamed_typedef_to_struct @
114 type unnamed_struct.t;
115 identifier unnamed_struct_type.i;
130 + __attribute__((packed))
178 /* This rule can't be named "void" */
179 @ replace_uppercase_void @