1 // prepare for transformation
4 idexpression struct list_head *I;
13 iterator name list_for_each_rcu;
26 iterator name list_for_each;
39 iterator name list_for_each_prev;
60 // the case where the list element is just stored in a variable
66 iterator name list_for_each_entry_rcu;
70 - list_for_each_rcu(_X(I),E1)
71 + list_for_each_entry_rcu(x,E1,E2)
73 ... when != \(_Y(I)\|_X(I)\|x=E\)
75 - x = list_entry(_X(I),T,E2);
76 ... when != \(_Y(I)\|_X(I)\|x=E\)
84 iterator name list_for_each_entry;
88 - list_for_each(_X(I),E1)
89 + list_for_each_entry(x,E1,E2)
91 ... when != \(_Y(I)\|_X(I)\|x=E\)
93 - x = list_entry(_X(I),T,E2);
94 ... when != \(_Y(I)\|_X(I)\|x=E\)
101 expression E, E1, E2;
102 iterator name list_for_each_entry_reverse;
106 - list_for_each_prev(_X(I),E1)
107 + list_for_each_entry_reverse(x,E1,E2)
109 ... when != \(_Y(I)\|_X(I)\|x=E\)
111 - x = list_entry(_X(I),T,E2);
112 ... when != \(_Y(I)\|_X(I)\|x=E\)
116 // instances of the above that we can't treat because of the local variable
117 // problem. seems better to do nothing.
135 - list_entry(_X(I),T,E2);
136 + _LOCAL_DECL(list_entry(_X(I),T,E2));
139 - list_entry(_X(I),T,E2);
140 + _LOCAL_DECL(list_entry(_X(I),T,E2));
161 - list_entry(_X(I),T,E2);
162 + _LOCAL_DECL(list_entry(_X(I),T,E2));
165 - list_entry(_X(I),T,E2);
166 + _LOCAL_DECL(list_entry(_X(I),T,E2));
187 - list_entry(_X(I),T,E2);
188 + _LOCAL_DECL(list_entry(_X(I),T,E2));
191 - list_entry(_X(I),T,E2);
192 + _LOCAL_DECL(list_entry(_X(I),T,E2));
197 // the case where the list element is used for something else (often a return)
205 - struct list_head *I;
208 - list_for_each_rcu(_X(I),E1)
209 + list_for_each_entry_rcu(I,E1,E2)
212 - list_entry(_X(I),T,E2)
224 - struct list_head *I;
227 - list_for_each(_X(I),E1)
228 + list_for_each_entry(I,E1,E2)
231 - list_entry(_X(I),T,E2)
243 - struct list_head *I;
246 - list_for_each_prev(_X(I),E1)
247 + list_for_each_entry_reverse(I,E1,E2)
250 - list_entry(_X(I),T,E2)
276 + _INCONSISTENT_MODIF(I)
279 + _INCONSISTENT_MODIF(I)
282 @ depends on r || ra @
286 - struct list_head *I;