bbd5c968 | 15-Jun-2022 |
Ziyang Xuan <william.xuanziyang@huawei.com> |
scripts/coccinelle/free: add NULL test before dev_{put, hold} functions
Since commit b37a46683739 ("netdevice: add the case if dev is NULL"), NULL check before dev_{put, hold} functions is not neede
scripts/coccinelle/free: add NULL test before dev_{put, hold} functions
Since commit b37a46683739 ("netdevice: add the case if dev is NULL"), NULL check before dev_{put, hold} functions is not needed.
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
8e54fe1b | 11-Jul-2022 |
Steven Rostedt (Google) <rostedt@goodmis.org> |
coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool
There is nothing wrong with current code that returns 0 or 1 for a function returning bool. It is perf
coccinelle: Remove script that checks replacing 0/1 with false/true in functions returning bool
There is nothing wrong with current code that returns 0 or 1 for a function returning bool. It is perfectly acceptable by the C standard.
To avoid churn of unwanted patches that are constantly sent to maintainers who do not care about this change, remove the script that flags it as an issue. This issue is not worth the burden on maintainers to accept useless patches.
Link: https://lore.kernel.org/all/20220705073822.7276-1-jiapeng.chong@linux.alibaba.com/ Link: https://lore.kernel.org/all/20220429075201.68581-1-jiapeng.chong@linux.alibaba.com/ Link: https://lore.kernel.org/all/1649236467-29390-1-git-send-email-baihaowen@meizu.com/ Link: https://lore.kernel.org/all/20220317014740.3138-1-jiapeng.chong@linux.alibaba.com/ Link: https://lore.kernel.org/all/190b5c2f2f2fb9cc775fce8daed72bf893be48a4.1642065293.git.davidcomponentone@gmail.com/ Link: https://lore.kernel.org/all/20211214113845.439392-1-deng.changcheng@zte.com.cn/ Link: https://lore.kernel.org/all/20210824065735.60660-1-deng.changcheng@zte.com.cn/ Link: https://lore.kernel.org/all/20210824064305.60081-1-deng.changcheng@zte.com.cn/ Link: https://lore.kernel.org/all/20210824062359.59474-1-deng.changcheng@zte.com.cn/
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Cc: Michal Marek <mmarek@suse.cz> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Julia Lawall <julia.lawall@inria.fr> Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
show more ...
|
3cdb8e99 | 26-Dec-2021 |
Julia Lawall <Julia.Lawall@inria.fr> |
drop fen.cocci
This semantic patch does not take into account the fact that of_node_put can be safely applied to NULL. Thus it gives only false positives. Drop it.
Reported-by: Qing Wang <wangqing
drop fen.cocci
This semantic patch does not take into account the fact that of_node_put can be safely applied to NULL. Thus it gives only false positives. Drop it.
Reported-by: Qing Wang <wangqing@vivo.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
5e523446 | 21-Jun-2021 |
Keith Busch <kbusch@kernel.org> |
coccinelle: api: remove kobj_to_dev.cocci script
Using kobj_to_dev() instead of container_of() is not universally accepted among maintainers as an improvement. The warning leads to repeated patch su
coccinelle: api: remove kobj_to_dev.cocci script
Using kobj_to_dev() instead of container_of() is not universally accepted among maintainers as an improvement. The warning leads to repeated patch submissions that won't be accepted. Remove the script.
Cc: Christoph Hellwig <hch@lst.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Denis Efremov <efremov@linux.com> Cc: Julia Lawall <Julia.Lawall@inria.fr> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Jens Axboe <axboe@kernel.dk> Acked-by: Denis Efremov <efremov@linux.com>
show more ...
|
aeb300c1 | 28-Apr-2021 |
Denis Efremov <efremov@linux.com> |
coccinelle: misc: minmax: suppress patch generation for err returns
There is a standard idiom for "if 'ret' holds an error, return it": return ret < 0 ? ret : 0;
Developers prefer to keep the thin
coccinelle: misc: minmax: suppress patch generation for err returns
There is a standard idiom for "if 'ret' holds an error, return it": return ret < 0 ? ret : 0;
Developers prefer to keep the things as they are because stylistic change to "return min(ret, 0);" breaks readability.
Let's suppress automatic generation for this type of patches.
Signed-off-by: Denis Efremov <efremov@linux.com>
show more ...
|
5d2db9bb | 23-Apr-2021 |
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> |
coccinelle: irqf_oneshot: reduce the severity due to false positives
The IRQF_ONESHOT should be present for threaded IRQ using default primary handler. However intetrupt of many child devices, e.g.
coccinelle: irqf_oneshot: reduce the severity due to false positives
The IRQF_ONESHOT should be present for threaded IRQ using default primary handler. However intetrupt of many child devices, e.g. children of MFD, is nested thus the IRQF_ONESHOT is not needed. The coccinelle message about error misleads submitters and reviewers about the severity of the issue, so make it a warning and mention possible false positive.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
show more ...
|
cb62732d | 08-Mar-2021 |
Denis Efremov <efremov@linux.com> |
coccinelle: misc: update uninitialized_var.cocci documentation
Remove the documentation link from the warning message because commit 3942ea7a10c9 ("deprecated.rst: Remove now removed uninitialized_v
coccinelle: misc: update uninitialized_var.cocci documentation
Remove the documentation link from the warning message because commit 3942ea7a10c9 ("deprecated.rst: Remove now removed uninitialized_var") removed the section from documentation. Update the rule documentation accordingly.
Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
show more ...
|
3afb532b | 08-Mar-2021 |
Denis Efremov <efremov@linux.com> |
coccinelle: misc: restrict patch mode in flexible_array.cocci
Skip patches generation for structs with a single field. Changing a zero-length array to a flexible array member in a struct with no nam
coccinelle: misc: restrict patch mode in flexible_array.cocci
Skip patches generation for structs with a single field. Changing a zero-length array to a flexible array member in a struct with no named members breaks the compilation. However, reporting such cases is still valuable, e.g. commit 637464c59e0b ("ACPI: NFIT: Fix flexible_array.cocci warnings").
Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
show more ...
|
b784c770 | 15-Dec-2020 |
Maxime Ripard <maxime@cerno.tech> |
coccinnelle: Remove ptr_ret script
The ptr_ret script script addresses a number of situations where we end up testing an error pointer, and if it's an error returning it, or return 0 otherwise to tr
coccinnelle: Remove ptr_ret script
The ptr_ret script script addresses a number of situations where we end up testing an error pointer, and if it's an error returning it, or return 0 otherwise to transform it into a PTR_ERR_OR_ZERO call.
So it will convert a block like this:
if (IS_ERR(err)) return PTR_ERR(err);
return 0;
into
return PTR_ERR_OR_ZERO(err);
While this is technically correct, it has a number of drawbacks. First, it merges the error and success path, which will make it harder for a reviewer or reader to grasp.
It's also more difficult to extend if we were to add some code between the error check and the function return, making the author essentially revert that patch before adding new lines, while it would have been a trivial addition otherwise for the rewiever.
Therefore, since that script is only about cosmetic in the first place, let's remove it since it's not worth it.
Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Julia Lawall <julia.lawall@inria.fr> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
show more ...
|
edc05fe5 | 16-Oct-2020 |
Denis Efremov <efremov@linux.com> |
coccinelle: api: add kfree_mismatch script
Check that alloc and free types of functions match each other.
Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <Julia.Lawall@
coccinelle: api: add kfree_mismatch script
Check that alloc and free types of functions match each other.
Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
show more ...
|
82c2d813 | 15-Oct-2020 |
Sumera Priyadarsini <sylphrenadin@gmail.com> |
coccinelle: iterators: Add for_each_child.cocci script
While iterating over child nodes with the for_each functions, if control is transferred from the middle of the loop, as in the case of a break
coccinelle: iterators: Add for_each_child.cocci script
While iterating over child nodes with the for_each functions, if control is transferred from the middle of the loop, as in the case of a break or return or goto, there is no decrement in the reference counter thus ultimately resulting in a memory leak.
Add this script to detect potential memory leaks caused by the absence of of_node_put() before break, goto, or, return statements which transfer control outside the loop.
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
show more ...
|
28c185a8 | 09-Oct-2020 |
Denis Efremov <efremov@linux.com> |
coccinelle: api: kfree_sensitive: print memset position
Print memset() call position in addition to the kfree() position to ease issues identification.
Signed-off-by: Denis Efremov <efremov@linux.c
coccinelle: api: kfree_sensitive: print memset position
Print memset() call position in addition to the kfree() position to ease issues identification.
Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
show more ...
|