4003ba66 | 28-Sep-2024 |
Julia Lawall <Julia.Lawall@inria.fr> |
Reduce Coccinelle choices in string_choices.cocci
The isomorphism neg_if_exp negates the test of a ?: conditional, making it unnecessary to have an explicit case for a negated test with the branches
Reduce Coccinelle choices in string_choices.cocci
The isomorphism neg_if_exp negates the test of a ?: conditional, making it unnecessary to have an explicit case for a negated test with the branches inverted.
At the same time, we can disable neg_if_exp in cases where a different API function may be more suitable for a negated test.
Finally, in the non-patch cases, E matches an expression with parentheses around it, so there is no need to mention () explicitly in the pattern. The () are still needed in the patch cases, because we want to drop them, if they are present.
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
f584e375 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Remove unnecessary parentheses for only one possible change.
The parentheses are only needed if there is a disjunction, ie a set of possible changes. If there is only one pattern, we can
coccinelle: Remove unnecessary parentheses for only one possible change.
The parentheses are only needed if there is a disjunction, ie a set of possible changes. If there is only one pattern, we can remove these parentheses. Just like the format:
- x + y
not:
( - x + y )
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
253244cd | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_yes_no() replacements
As other rules done, we add rules for str_yes_no() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Sign
coccinelle: Add rules to find str_yes_no() replacements
As other rules done, we add rules for str_yes_no() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
9b5b4810 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_on_off() replacements
As other rules done, we add rules for str_on_off() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Sign
coccinelle: Add rules to find str_on_off() replacements
As other rules done, we add rules for str_on_off() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
c81ca023 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_write_read() replacements
As other rules done, we add rules for str_write_read() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.c
coccinelle: Add rules to find str_write_read() replacements
As other rules done, we add rules for str_write_read() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
ba4b514a | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_read_write() replacements
As other rules done, we add rules for str_read_write() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.c
coccinelle: Add rules to find str_read_write() replacements
As other rules done, we add rules for str_read_write() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
dd2275d3 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_enable{d}_disable{d}() replacements
As other rules done, we add rules for str_enable{d}_ disable{d}() to check the relative opportunities.
Signed-off-by: Hongbo Li
coccinelle: Add rules to find str_enable{d}_disable{d}() replacements
As other rules done, we add rules for str_enable{d}_ disable{d}() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
5b7ca450 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements
As other rules done, we add rules for str_lo{w}_hi{gh}() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huaw
coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements
As other rules done, we add rules for str_lo{w}_hi{gh}() to check the relative opportunities.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
d4c75440 | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
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@huaw
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>
show more ...
|
8a0236ba | 11-Sep-2024 |
Hongbo Li <lihongbo22@huawei.com> |
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 t
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>
show more ...
|
0336f898 | 12-Aug-2024 |
Kees Cook <kees@kernel.org> |
coccinelle: Add rules to find str_down_up() replacements
As done with str_up_down(), add checks for str_down_up() opportunities. 5 cases currently exist in the tree.
Suggested-by: Andy Shevchenko <
coccinelle: Add rules to find str_down_up() replacements
As done with str_up_down(), add checks for str_down_up() opportunities. 5 cases currently exist in the tree.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240812183637.work.999-kees@kernel.org Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Kees Cook <kees@kernel.org>
show more ...
|
ff82e84e | 20-Jan-2024 |
Julia Lawall <Julia.Lawall@inria.fr> |
coccinelle: device_attr_show: simplify patch case
Replacing the final expression argument by ... allows the format string to have multiple arguments.
It also has the advantage of allowing the chang
coccinelle: device_attr_show: simplify patch case
Replacing the final expression argument by ... allows the format string to have multiple arguments.
It also has the advantage of allowing the change to be recognized as a change in a single statement, thus avoiding adding unneeded braces.
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|