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_false_true() replacements

As done with str_true_false(), add checks for str_false_true()
opportunities. A simple test can find over 9 cases currently
exist in the tree.

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
8a0236ba 716bf84e

+19
+19
scripts/coccinelle/api/string_choices.cocci
··· 104 104 @@ 105 105 106 106 coccilib.report.print_report(p[0], "opportunity for str_true_false(%s)" % e) 107 + 108 + @str_false_true depends on patch@ 109 + expression E; 110 + @@ 111 + - ((E) ? "false" : "true") 112 + + str_false_true(E) 113 + 114 + @str_false_true_r depends on !patch exists@ 115 + expression E; 116 + position P; 117 + @@ 118 + * ((E@P) ? "false" : "true") 119 + 120 + @script:python depends on report@ 121 + p << str_false_true_r.P; 122 + e << str_false_true_r.E; 123 + @@ 124 + 125 + coccilib.report.print_report(p[0], "opportunity for str_false_true(%s)" % e)