<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/coccinelle, 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-06-21T18:45:49Z</updated>
<entry>
<title>coccinelle: api: remove kobj_to_dev.cocci script</title>
<updated>2021-06-21T18:45:49Z</updated>
<author>
<name>Keith Busch</name>
<email>kbusch@kernel.org</email>
</author>
<published>2021-06-21T17:48:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e5234462756a39e56f4182694f47ec72b5abe52'/>
<id>urn:sha1:5e5234462756a39e56f4182694f47ec72b5abe52</id>
<content type='text'>
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 &lt;hch@lst.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Denis Efremov &lt;efremov@linux.com&gt;
Cc: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Acked-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Acked-by: Denis Efremov &lt;efremov@linux.com&gt;
</content>
</entry>
<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>drop unneeded *s</title>
<updated>2021-05-01T19:23:57Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2021-04-28T07:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=32c465613959248a8db8a1458d65a266411ddccc'/>
<id>urn:sha1:32c465613959248a8db8a1458d65a266411ddccc</id>
<content type='text'>
Kfree.cocci only supports org and report mode, so the *s (used for
context mode) are not useful.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&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>of: Remove of_dev_{get,put}()</title>
<updated>2021-02-13T01:23:39Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2021-02-11T23:27:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83c4a4eec06a8fc46fc68c437424f9c89e4d9c72'/>
<id>urn:sha1:83c4a4eec06a8fc46fc68c437424f9c89e4d9c72</id>
<content type='text'>
of_dev_get() and of_dev_put are just wrappers for get_device()/put_device()
on a platform_device. There's also already platform_device_{get,put}()
wrappers for this purpose. Let's update the few users and remove
of_dev_{get,put}().

Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Frank Rowand &lt;frowand.list@gmail.com&gt;
Cc: Patrice Chotard &lt;patrice.chotard@st.com&gt;
Cc: Felipe Balbi &lt;balbi@kernel.org&gt;
Cc: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Cc: Gilles Muller &lt;Gilles.Muller@inria.fr&gt;
Cc: Nicolas Palix &lt;nicolas.palix@imag.fr&gt;
Cc: Michal Marek &lt;michal.lkml@markovi.net&gt;
Cc: linuxppc-dev@lists.ozlabs.org
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: cocci@systeme.lip6.fr
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20210211232745.1498137-2-robh@kernel.org
</content>
</entry>
<entry>
<title>coccinnelle: Remove ptr_ret script</title>
<updated>2020-12-15T19:55:19Z</updated>
<author>
<name>Maxime Ripard</name>
<email>maxime@cerno.tech</email>
</author>
<published>2020-12-15T12:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b784c77075023e1a71bc06e6b4f711acb99e9c73'/>
<id>urn:sha1:b784c77075023e1a71bc06e6b4f711acb99e9c73</id>
<content type='text'>
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 &lt;jani.nikula@intel.com&gt;
Acked-by: Thierry Reding &lt;treding@nvidia.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Reviewed-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Maxime Ripard &lt;maxime@cerno.tech&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
</content>
</entry>
</feed>
