Lines Matching +full:y +full:- +full:max
1 // SPDX-License-Identifier: GPL-2.0-only
3 /// Check for opencoded min(), max() implementations.
9 // Options: --no-includes --include-headers
11 // Keywords: min, max
22 expression x, y;
30 * ((x) cmp@p (y) ? (x) : (y))
36 expression x, y;
45 * if ((x) cmp@p (y)) {
48 * max_val = (y);
70 expression x, y;
78 * ((x) cmp@p (y) ? (x) : (y))
84 expression x, y;
93 * if ((x) cmp@p (y)) {
96 * min_val = (y);
103 expression x, y;
110 - ((x) cmp (y) ? (x) : (y))
111 + max(x, y)
117 expression x, y;
125 - if ((x) cmp (y)) {
126 - max_val = x;
127 - } else {
128 - max_val = y;
129 - }
130 + max_val = max(x, y);
136 expression x, y;
144 - ((x) cmp@p (y) ? (x) : (y))
145 + min(x, y)
151 expression x, y;
159 - if ((x) cmp (y)) {
160 - min_val = x;
161 - } else {
162 - min_val = y;
163 - }
164 + min_val = min(x, y);
173 coccilib.report.print_report(p0, "WARNING opportunity for max()")
180 coccilib.org.print_todo(p0, "WARNING opportunity for max()")
187 coccilib.report.print_report(p0, "WARNING opportunity for max()")
194 coccilib.org.print_todo(p0, "WARNING opportunity for max()")