Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coccinelle: Add rules to find str_true_false() replacements

After str_true_false() has been introduced in the tree,
we can add rules for finding places where str_true_false()
can be used. A simple test can find over 10 locations.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

authored by

Hongbo Li and committed by
Julia Lawall
716bf84e 3efc5736

+19
+19
scripts/coccinelle/api/string_choices.cocci
··· 85 85 @@ 86 86 87 87 coccilib.report.print_report(p[0], "opportunity for str_down_up(%s)" % e) 88 + 89 + @str_true_false depends on patch@ 90 + expression E; 91 + @@ 92 + - ((E) ? "true" : "false") 93 + + str_true_false(E) 94 + 95 + @str_true_false_r depends on !patch exists@ 96 + expression E; 97 + position P; 98 + @@ 99 + * ((E@P) ? "true" : "false") 100 + 101 + @script:python depends on report@ 102 + p << str_true_false_r.P; 103 + e << str_true_false_r.E; 104 + @@ 105 + 106 + coccilib.report.print_report(p[0], "opportunity for str_true_false(%s)" % e)