string_choices.cocci (9b5b4810559d3716aef9fdc8d555e4db1a031749) string_choices.cocci (253244cdf16a755039f9078b0a785176712f2584)
1// SPDX-License-Identifier: GPL-2.0-only
2/// Find places to use string_choices.h's various helpers.
3//
4// Confidence: Medium
5// Options: --no-includes --include-headers
6virtual patch
7virtual context
8virtual report

--- 284 unchanged lines hidden (view full) ---

293* ((E@P) ? "on" : "off")
294
295@script:python depends on report@
296p << str_on_off_r.P;
297e << str_on_off_r.E;
298@@
299
300coccilib.report.print_report(p[0], "opportunity for str_on_off(%s)" % e)
1// SPDX-License-Identifier: GPL-2.0-only
2/// Find places to use string_choices.h's various helpers.
3//
4// Confidence: Medium
5// Options: --no-includes --include-headers
6virtual patch
7virtual context
8virtual report

--- 284 unchanged lines hidden (view full) ---

293* ((E@P) ? "on" : "off")
294
295@script:python depends on report@
296p << str_on_off_r.P;
297e << str_on_off_r.E;
298@@
299
300coccilib.report.print_report(p[0], "opportunity for str_on_off(%s)" % e)
301
302@str_yes_no depends on patch@
303expression E;
304@@
305- ((E) ? "yes" : "no")
306+ str_yes_no(E)
307
308@str_yes_no_r depends on !patch exists@
309expression E;
310position P;
311@@
312* ((E@P) ? "yes" : "no")
313
314@script:python depends on report@
315p << str_yes_no_r.P;
316e << str_yes_no_r.E;
317@@
318
319coccilib.report.print_report(p[0], "opportunity for str_yes_no(%s)" % e)