<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/coccinelle/misc, branch v5.10</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.10</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.10'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-10-03T20:08:40Z</updated>
<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>
<entry>
<title>Merge branch 'for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux</title>
<updated>2020-08-06T18:34:35Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-08-06T18:34:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e3243e2a273d79c69d821e27cd246089638c472a'/>
<id>urn:sha1:e3243e2a273d79c69d821e27cd246089638c472a</id>
<content type='text'>
Pull coccinelle updates from Julia Lawall:
 "New semantic patches and semantic patch improvements from Denis
  Efremov"

* 'for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
  coccinelle: api: filter out memdup_user definitions
  coccinelle: api: extend memdup_user rule with vmemdup_user()
  coccinelle: api: extend memdup_user transformation with GFP_USER
  coccinelle: api: add kzfree script
  coccinelle: misc: add array_size_dup script to detect missed overflow checks
  coccinelle: api/kstrdup: fix coccinelle position
  coccinelle: api: add device_attr_show script
</content>
</entry>
<entry>
<title>coccinelle: misc: add array_size_dup script to detect missed overflow checks</title>
<updated>2020-08-04T20:46:58Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-06-22T22:10:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=de50862520480b90ec2fcaed6ad1ad41462fbf30'/>
<id>urn:sha1:de50862520480b90ec2fcaed6ad1ad41462fbf30</id>
<content type='text'>
Detect an opencoded expression that is used before or after
array_size()/array3_size()/struct_size() to compute the same size.

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>scripts: add dummy report mode to add_namespace.cocci</title>
<updated>2020-07-10T12:19:58Z</updated>
<author>
<name>Matthias Maennich</name>
<email>maennich@google.com</email>
</author>
<published>2020-06-04T16:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55c7549819e438f40a3ef1d8ac5c38b73390bcb7'/>
<id>urn:sha1:55c7549819e438f40a3ef1d8ac5c38b73390bcb7</id>
<content type='text'>
When running `make coccicheck` in report mode using the
add_namespace.cocci file, it will fail for files that contain
MODULE_LICENSE. Those match the replacement precondition, but spatch
errors out as virtual.ns is not set.

In order to fix that, add the virtual rule nsdeps and only do search and
replace if that rule has been explicitly requested.

In order to make spatch happy in report mode, we also need a dummy rule,
as otherwise it errors out with "No rules apply". Using a script:python
rule appears unrelated and odd, but this is the shortest I could come up
with.

Adjust scripts/nsdeps accordingly to set the nsdeps rule when run trough
`make nsdeps`.

Suggested-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Fixes: c7c4e29fb5a4 ("scripts: add_namespace: Fix coccicheck failed")
Cc: YueHaibing &lt;yuehaibing@huawei.com&gt;
Cc: jeyu@kernel.org
Cc: cocci@systeme.lip6.fr
Cc: stable@vger.kernel.org
Signed-off-by: Matthias Maennich &lt;maennich@google.com&gt;
Reported-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/20200604164145.173925-1-maennich@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: remove newlines in NL_SET_ERR_MSG_MOD</title>
<updated>2020-05-08T00:56:14Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.e.keller@intel.com</email>
</author>
<published>2020-05-07T00:58:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c75a33c84b83ffbb8b8b58a6bf4dea69dba21326'/>
<id>urn:sha1:c75a33c84b83ffbb8b8b58a6bf4dea69dba21326</id>
<content type='text'>
The NL_SET_ERR_MSG_MOD macro is used to report a string describing an
error message to userspace via the netlink extended ACK structure. It
should not have a trailing newline.

Add a cocci script which catches cases where the newline marker is
present. Using this script, fix the handful of cases which accidentally
included a trailing new line.

I couldn't figure out a way to get a patch mode working, so this script
only implements context, report, and org.

Signed-off-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>scripts: add_namespace: Fix coccicheck failed</title>
<updated>2019-10-07T14:37:53Z</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2019-10-06T04:44:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7c4e29fb5a422fd144b3fb0d3e32375d8f9b0ba'/>
<id>urn:sha1:c7c4e29fb5a422fd144b3fb0d3e32375d8f9b0ba</id>
<content type='text'>
Now all scripts in scripts/coccinelle to be automatically called
by coccicheck. However new adding add_namespace.cocci does not
support report mode, which make coccicheck failed.
This add "virtual report" to  make the coccicheck go ahead smoothly.

Fixes: eb8305aecb95 ("scripts: Coccinelle script for namespace dependencies.")
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Acked-by: Matthias Maennich &lt;maennich@google.com&gt;
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Jessica Yu &lt;jeyu@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts: Coccinelle script for namespace dependencies.</title>
<updated>2019-09-10T08:30:43Z</updated>
<author>
<name>Matthias Maennich</name>
<email>maennich@google.com</email>
</author>
<published>2019-09-06T10:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb8305aecb958e8787e7d603c7765c1dcace3a2b'/>
<id>urn:sha1:eb8305aecb958e8787e7d603c7765c1dcace3a2b</id>
<content type='text'>
A script that uses the '&lt;module&gt;.ns_deps' files generated by modpost to
automatically add the required symbol namespace dependencies to each
module.

Usage:
1) Move some symbols to a namespace with EXPORT_SYMBOL_NS() or define
   DEFAULT_SYMBOL_NAMESPACE
2) Run 'make' (or 'make modules') and get warnings about modules not
   importing that namespace.
3) Run 'make nsdeps' to automatically add required import statements
   to said modules.

This makes it easer for subsystem maintainers to introduce and maintain
symbol namespaces into their codebase.

Co-developed-by: Martijn Coenen &lt;maco@android.com&gt;
Signed-off-by: Martijn Coenen &lt;maco@android.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Matthias Maennich &lt;maennich@google.com&gt;
Signed-off-by: Jessica Yu &lt;jeyu@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505</title>
<updated>2019-06-19T15:11:22Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f904d7e1f3ec7c2de47c024a5a5c30988b54703'/>
<id>urn:sha1:7f904d7e1f3ec7c2de47c024a5a5c30988b54703</id>
<content type='text'>
Based on 1 normalized pattern(s):

  gplv2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 58 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081207.556988620@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
