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_hi{gh}_lo{w}() replacements

As other rules done, we add rules for str_hi{gh}_lo{w}()
to check the relative opportunities.

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
d4c75440 8a0236ba

+42
+42
scripts/coccinelle/api/string_choices.cocci
··· 123 123 @@ 124 124 125 125 coccilib.report.print_report(p[0], "opportunity for str_false_true(%s)" % e) 126 + 127 + @str_hi_lo depends on patch@ 128 + expression E; 129 + @@ 130 + ( 131 + - ((E) ? "hi" : "lo") 132 + + str_hi_lo(E) 133 + ) 134 + 135 + @str_hi_lo_r depends on !patch exists@ 136 + expression E; 137 + position P; 138 + @@ 139 + ( 140 + * ((E@P) ? "hi" : "lo") 141 + ) 142 + 143 + @script:python depends on report@ 144 + p << str_hi_lo_r.P; 145 + e << str_hi_lo_r.E; 146 + @@ 147 + 148 + coccilib.report.print_report(p[0], "opportunity for str_hi_lo(%s)" % e) 149 + 150 + @str_high_low depends on patch@ 151 + expression E; 152 + @@ 153 + - ((E) ? "high" : "low") 154 + + str_high_low(E) 155 + 156 + @str_high_low_r depends on !patch exists@ 157 + expression E; 158 + position P; 159 + @@ 160 + * ((E@P) ? "high" : "low") 161 + 162 + @script:python depends on report@ 163 + p << str_high_low_r.P; 164 + e << str_high_low_r.E; 165 + @@ 166 + 167 + coccilib.report.print_report(p[0], "opportunity for str_high_low(%s)" % e)