<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/coccinelle/misc, branch v5.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-05-01T19:27:10Z</updated>
<entry>
<title>coccinelle: misc: minmax: suppress patch generation for err returns</title>
<updated>2021-05-01T19:27:10Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2021-04-28T06:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aeb300c1dbfc77b493728f608dd14d6814676546'/>
<id>urn:sha1:aeb300c1dbfc77b493728f608dd14d6814676546</id>
<content type='text'>
There is a standard idiom for "if 'ret' holds an error, return it":
	return ret &lt; 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 &lt;efremov@linux.com&gt;
</content>
</entry>
<entry>
<title>coccinelle: irqf_oneshot: reduce the severity due to false positives</title>
<updated>2021-05-01T19:23:57Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-04-23T10:00:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d2db9bb5f8a850d037983f0df72ad59cefa9e3d'/>
<id>urn:sha1:5d2db9bb5f8a850d037983f0df72ad59cefa9e3d</id>
<content type='text'>
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 &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: add swap script</title>
<updated>2021-05-01T19:23:56Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2021-03-05T10:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7845daa8bd72efa8bbc1de122edfce6e058bbe41'/>
<id>urn:sha1:7845daa8bd72efa8bbc1de122edfce6e058bbe41</id>
<content type='text'>
Check for opencoded swap() implementation.

Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: update uninitialized_var.cocci documentation</title>
<updated>2021-05-01T19:23:56Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2021-03-08T07:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb62732d3bf0cd4c136d5927b003f002ff658e1c'/>
<id>urn:sha1:cb62732d3bf0cd4c136d5927b003f002ff658e1c</id>
<content type='text'>
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 &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: restrict patch mode in flexible_array.cocci</title>
<updated>2021-05-01T19:23:56Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2021-03-08T19:12:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3afb532b19df3238dede98b184bc8852517f206a'/>
<id>urn:sha1:3afb532b19df3238dede98b184bc8852517f206a</id>
<content type='text'>
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 &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: add minmax script</title>
<updated>2021-05-01T19:23:56Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2021-03-09T06:39:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408'/>
<id>urn:sha1:5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408</id>
<content type='text'>
Check for opencoded min(), max() implementations.

Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>remove boolinit.cocci</title>
<updated>2020-11-09T16:20:36Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-11-09T11:39:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2b076054e524a92e3a303de487dfb7cf85d8e149'/>
<id>urn:sha1:2b076054e524a92e3a303de487dfb7cf85d8e149</id>
<content type='text'>
0/1 for booleans is perfectly valid C.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: add flexible_array.cocci script</title>
<updated>2020-10-03T20:08:40Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-09-21T17:49:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7b36c1398fb63f9c38cc83dc75f143d2e5995062'/>
<id>urn:sha1:7b36c1398fb63f9c38cc83dc75f143d2e5995062</id>
<content type='text'>
One-element and zero-length arrays are deprecated [1]. Kernel
code should always use "flexible array members" instead, except
for existing uapi definitions.

The script warns about one-element and zero-length arrays in structs.

[1] commit 68e4cd17e218 ("docs: deprecated.rst: Add zero-length and
    one-element arrays")

Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: add excluded_middle.cocci script</title>
<updated>2020-09-21T17:45:46Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-09-21T15:28:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b76f0ea013125358d1b4ca147a6f9b6883dd2493'/>
<id>urn:sha1:b76f0ea013125358d1b4ca147a6f9b6883dd2493</id>
<content type='text'>
Check for !A || A &amp;&amp; B condition. It's equivalent to !A || B.

Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: misc: add uninitialized_var.cocci script</title>
<updated>2020-09-05T17:13:28Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-09-01T09:48:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7c9dc603d55617edcc3190f9a6d7b5cf763feb57'/>
<id>urn:sha1:7c9dc603d55617edcc3190f9a6d7b5cf763feb57</id>
<content type='text'>
uninitialized_var() macro was removed from the sources [1] and
other warning-silencing tricks were deprecated [2]. The purpose of this
cocci script is to prevent new occurrences of uninitialized_var()
open-coded variants.

[1] commit 63a0895d960a ("compiler: Remove uninitialized_var() macro")
[2] commit 4b19bec97c88 ("docs: deprecated.rst: Add uninitialized_var()")

Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
</feed>
