<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/scripts/coccinelle, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/scripts/coccinelle?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/scripts/coccinelle?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-01-15T11:15:35Z</updated>
<entry>
<title>drop fen.cocci</title>
<updated>2022-01-15T11:15:35Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2021-12-26T10:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=3cdb8e995ee2e393b66d2abe156b90475009ec41'/>
<id>urn:sha1:3cdb8e995ee2e393b66d2abe156b90475009ec41</id>
<content type='text'>
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 &lt;wangqing@vivo.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>scripts/coccinelle: drop bugon.cocci</title>
<updated>2022-01-15T11:15:35Z</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@inria.fr</email>
</author>
<published>2021-11-27T18:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=92b2dadaa624d69465dd94ce3d0f30fc2f70170e'/>
<id>urn:sha1:92b2dadaa624d69465dd94ce3d0f30fc2f70170e</id>
<content type='text'>
The BUG_ON script was never safe, in that it was not able to check
whether the condition was side-effecting.  At this point, BUG_ON
should be well known, so it has probably outlived its usefuless.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Suggested-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'coccinelle-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux</title>
<updated>2021-11-13T18:45:17Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-11-13T18:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a9b9669d98229c1f6d228697af99a9b01b7b69ac'/>
<id>urn:sha1:a9b9669d98229c1f6d228697af99a9b01b7b69ac</id>
<content type='text'>
Pull coccinelle updates from Julia Lawall:

 - Update MAINTAINERS information (mailing list, web page, etc).

 - Add a semantic patch from Wen Yang to check for do_div calls that may
   cause truncation, motivated by commit b0ab99e7736a ("sched: Fix
   possible divide by zero in avg_atom() calculation")

* tag 'coccinelle-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
  coccinelle: update Coccinelle entry
  coccinelle: semantic patch to check for inappropriate do_div() calls
</content>
</entry>
<entry>
<title>coccinelle: semantic patch to check for inappropriate do_div() calls</title>
<updated>2021-09-11T20:57:39Z</updated>
<author>
<name>Wen Yang</name>
<email>wenyang@linux.alibaba.com</email>
</author>
<published>2020-01-10T13:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ac5f313624d876b41d4a1292181d17e80d44159c'/>
<id>urn:sha1:ac5f313624d876b41d4a1292181d17e80d44159c</id>
<content type='text'>
do_div() does a 64-by-32 division.
When the divisor is unsigned long, u64, or s64,
do_div() truncates it to 32 bits, this means it
can test non-zero and be truncated to zero for division.
This semantic patch is inspired by Mateusz Guzik's patch:
commit b0ab99e7736a ("sched: Fix possible divide by zero in avg_atom() calculation")

Signed-off-by: Wen Yang &lt;wenyang@linux.alibaba.com&gt;
Signed-off-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Cc: Gilles Muller &lt;Gilles.Muller@lip6.fr&gt;
Cc: Nicolas Palix &lt;nicolas.palix@imag.fr&gt;
Cc: Michal Marek &lt;michal.lkml@markovi.net&gt;
Cc: Matthias Maennich &lt;maennich@google.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: cocci@systeme.lip6.fr
Cc: linux-kernel@vger.kernel.org
</content>
</entry>
<entry>
<title>scripts: coccinelle: allow list_entry_is_head() to use pos</title>
<updated>2021-08-08T20:00:49Z</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2021-07-30T09:58:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e71ec0bc06038cdfa18cbd23f5cea71fe4785d35'/>
<id>urn:sha1:e71ec0bc06038cdfa18cbd23f5cea71fe4785d35</id>
<content type='text'>
Currently use_after_iter.cocci generates false positives for code of the
following form:
~~~
	list_for_each_entry(d, &amp;ddata-&gt;irq_list, node) {
		if (irq == d-&gt;irq)
			break;
	}

	if (list_entry_is_head(d, &amp;ddata-&gt;irq_list, node))
		return IRQ_NONE;
~~~
[This specific example comes from drivers/power/supply/cpcap-battery.c]

Most list macros use list_entry_is_head() as loop exit condition meaning it
is not unsafe to reuse pos (a.k.a. d) in the code above.

Let's avoid reporting these cases.

Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
</content>
</entry>
<entry>
<title>coccinelle: api: rename kzfree to kfree_sensitive</title>
<updated>2021-08-05T11:01:09Z</updated>
<author>
<name>Weizhao Ouyang</name>
<email>o451686892@gmail.com</email>
</author>
<published>2021-08-05T09:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9eec0792024983276871baeb201609abb07dd35d'/>
<id>urn:sha1:9eec0792024983276871baeb201609abb07dd35d</id>
<content type='text'>
Commit 453431a54934 ("mm, treewide: rename kzfree() to
kfree_sensitive()") renamed kzfree() to kfree_sensitive(),
it should be applied to coccinelle.

Signed-off-by: Weizhao Ouyang &lt;o451686892@gmail.com&gt;
Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Acked-by: Denis Efremov &lt;efremov@linux.com&gt;
</content>
</entry>
<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.zx2c4.com/linux-dev/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.zx2c4.com/linux-dev/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.zx2c4.com/linux-dev/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.zx2c4.com/linux-dev/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>
</feed>
