<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/scripts/coccinelle, branch v4.9.16</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Coccinelle: flag conditions with no effect</title>
<updated>2016-10-11T07:57:17+00:00</updated>
<author>
<name>Nicholas Mc Guire</name>
<email>hofrat@osadl.org</email>
</author>
<published>2016-10-08T15:51:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c8990359d4b12f14656386526ddf904635076902'/>
<id>c8990359d4b12f14656386526ddf904635076902</id>
<content type='text'>
Report code constructs where the if and else branch are functionally
identical. In cases where this is intended it really should be
documented - most reported cases probably are bugs.

Signed-off-by: Nicholas Mc Guire &lt;hofrat@osadl.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Report code constructs where the if and else branch are functionally
identical. In cases where this is intended it really should be
documented - most reported cases probably are bugs.

Signed-off-by: Nicholas Mc Guire &lt;hofrat@osadl.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Coccinelle: pm_runtime: ensure relevance of pm_runtime reports</title>
<updated>2016-10-01T21:03:41+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2016-09-22T08:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d97629f1686574a800a76eb0d2ce65e3f3d3ef92'/>
<id>d97629f1686574a800a76eb0d2ce65e3f3d3ef92</id>
<content type='text'>
pm_runtime.cocci starts with one rule that searches for a variety of
functions calls, followed by various rules that report errors.  Previously,
the only connection between the first rule and the rest was to check that
the first rule had matched somewhere.  Change the rules to propagate a
position from the first rule to the others, to make sure that the sites
reported on are the same as the sites that were identified as having the
relevant functions.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pm_runtime.cocci starts with one rule that searches for a variety of
functions calls, followed by various rules that report errors.  Previously,
the only connection between the first rule and the rest was to check that
the first rule had matched somewhere.  Change the rules to propagate a
position from the first rule to the others, to make sure that the sites
reported on are the same as the sites that were identified as having the
relevant functions.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Coccinelle: limit memdup_user transformation to GFP_KERNEL case</title>
<updated>2016-10-01T21:03:09+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2016-09-21T15:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=43d96390d57aa0e61d15ce2bcb887df8516d58f5'/>
<id>43d96390d57aa0e61d15ce2bcb887df8516d58f5</id>
<content type='text'>
Memdup_user encapsulates a memory allocation with the flag GFP_KERNEL, so
only allow this flag in the original code.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Memdup_user encapsulates a memory allocation with the flag GFP_KERNEL, so
only allow this flag in the original code.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/coccinelle: require coccinelle &gt;= 1.0.4 on device_node_continue.cocci</title>
<updated>2016-07-22T10:13:39+00:00</updated>
<author>
<name>Luis R. Rodriguez</name>
<email>mcgrof@kernel.org</email>
</author>
<published>2016-06-29T22:14:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cc65e823363834a7ff0a2eca9bef2bbef64135f7'/>
<id>cc65e823363834a7ff0a2eca9bef2bbef64135f7</id>
<content type='text'>
Make use of the new Requires: tag to be able to specify coccinelle binary
version requirements. The cocci file device_node_continue.cocci requires at
least coccinelle 1.0.4.

Signed-off-by: Luis R. Rodriguez &lt;mcgrof@kernel.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Acked-by: Nicolas Palix &lt;nicolas.palix@imag.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make use of the new Requires: tag to be able to specify coccinelle binary
version requirements. The cocci file device_node_continue.cocci requires at
least coccinelle 1.0.4.

Signed-off-by: Luis R. Rodriguez &lt;mcgrof@kernel.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Acked-by: Nicolas Palix &lt;nicolas.palix@imag.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>coccinelle: catch krealloc() on devm_*() allocated memory</title>
<updated>2016-06-21T09:43:32+00:00</updated>
<author>
<name>Yann Droneaud</name>
<email>ydroneaud@opteya.com</email>
</author>
<published>2016-05-23T15:07:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b7b2ee41f300b69c67c798df0cd5b8648bcb26a3'/>
<id>b7b2ee41f300b69c67c798df0cd5b8648bcb26a3</id>
<content type='text'>
krealloc() must not be used against devm_*() allocated
memory regions:

- if a bigger memory is to be allocated, krealloc() and
  __krealloc() could return a different pointer than the
  one given to them, creating a memory region which is not
  managed, thus it will not be automatically released on
  device removal.

- if a bigger memory is to be allocated, krealloc() could
  kfree() the managed memory region which is passed to it.
  The old pointer is left registered as a resource for the
  device. On device removal, this dangling pointer will be
  used and an unrelated memory region could be released.

- if the requested size is equal to 0, krealloc() can also
  just behave like kfree(). Here too, the old pointer is
  kept associated with the device. On device removal, this
  invalid pointer will be used and an unrelated memory
  region could be released.

For all these reasons, krealloc() must not be used on a
pointer returned by devm_*() functions.

Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
krealloc() must not be used against devm_*() allocated
memory regions:

- if a bigger memory is to be allocated, krealloc() and
  __krealloc() could return a different pointer than the
  one given to them, creating a memory region which is not
  managed, thus it will not be automatically released on
  device removal.

- if a bigger memory is to be allocated, krealloc() could
  kfree() the managed memory region which is passed to it.
  The old pointer is left registered as a resource for the
  device. On device removal, this dangling pointer will be
  used and an unrelated memory region could be released.

- if the requested size is equal to 0, krealloc() can also
  just behave like kfree(). Here too, the old pointer is
  kept associated with the device. On device removal, this
  invalid pointer will be used and an unrelated memory
  region could be released.

For all these reasons, krealloc() must not be used on a
pointer returned by devm_*() functions.

Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>coccinelle: recognize more devm_* memory allocation functions</title>
<updated>2016-06-21T09:43:32+00:00</updated>
<author>
<name>Yann Droneaud</name>
<email>ydroneaud@opteya.com</email>
</author>
<published>2016-05-23T15:07:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a720c0644d14011d3a1bcc8d1b36e80571ad2ce1'/>
<id>a720c0644d14011d3a1bcc8d1b36e80571ad2ce1</id>
<content type='text'>
Updates free/devm_free.cocci to recognize functions added by:

- commit 64c862a839a8 ('devres: add kernel standard devm_k.alloc functions')
- commit e31108cad3de ('devres: introduce API "devm_kstrdup"')
- commit 3046365bb470 ('devres: introduce API "devm_kmemdup')
- commit 43339bed7010 ('devres: Add devm_get_free_pages API')
- commit 75f2a4ead5d5 ('devres: Add devm_kasprintf and devm_kvasprintf API')

See also Documentation/driver-model/devres.txt

Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Manish Badarkhe &lt;badarkhe.manish@gmail.com&gt;
Cc: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Cc: Eli Billauer &lt;eli.billauer@gmail.com&gt;
Cc: Himangi Saraogi &lt;himangi774@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Cc: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Updates free/devm_free.cocci to recognize functions added by:

- commit 64c862a839a8 ('devres: add kernel standard devm_k.alloc functions')
- commit e31108cad3de ('devres: introduce API "devm_kstrdup"')
- commit 3046365bb470 ('devres: introduce API "devm_kmemdup')
- commit 43339bed7010 ('devres: Add devm_get_free_pages API')
- commit 75f2a4ead5d5 ('devres: Add devm_kasprintf and devm_kvasprintf API')

See also Documentation/driver-model/devres.txt

Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Manish Badarkhe &lt;badarkhe.manish@gmail.com&gt;
Cc: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Cc: Eli Billauer &lt;eli.billauer@gmail.com&gt;
Cc: Himangi Saraogi &lt;himangi774@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: Wolfram Sang &lt;w.sang@pengutronix.de&gt;
Cc: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>coccinelle: also catch kzfree() issues</title>
<updated>2016-06-21T09:43:32+00:00</updated>
<author>
<name>Yann Droneaud</name>
<email>ydroneaud@opteya.com</email>
</author>
<published>2016-05-23T15:07:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6dd9379e8f327e70d182b15be3ba21aa2b5d2cba'/>
<id>6dd9379e8f327e70d182b15be3ba21aa2b5d2cba</id>
<content type='text'>
Since commit 3ef0e5ba4673 ('slab: introduce kzfree()'),
kfree() is no more the only function to be considered:
kzfree() should be recognized too.

In particular, kzfree() must not be called on memory
allocated through devm_*() functions.

Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit 3ef0e5ba4673 ('slab: introduce kzfree()'),
kfree() is no more the only function to be considered:
kzfree() should be recognized too.

In particular, kzfree() must not be called on memory
allocated through devm_*() functions.

Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Yann Droneaud &lt;ydroneaud@opteya.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Coccinelle: noderef: Add new rules and correct the old rule</title>
<updated>2016-06-20T15:20:13+00:00</updated>
<author>
<name>Vaishali Thakkar</name>
<email>vaishali.thakkar@oracle.com</email>
</author>
<published>2016-05-24T04:19:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bf56cc04ef97c8ec536e3fcd16fc57902cba339f'/>
<id>bf56cc04ef97c8ec536e3fcd16fc57902cba339f</id>
<content type='text'>
Add new rules to detect the cases where sizeof is used in
function calls as a argument.

Also, for the patch mode third rule should behave same as
second rule with arguments reversed. So, change that as well.

Signed-off-by: Vaishali Thakkar &lt;vaishali.thakkar@oracle.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add new rules to detect the cases where sizeof is used in
function calls as a argument.

Also, for the patch mode third rule should behave same as
second rule with arguments reversed. So, change that as well.

Signed-off-by: Vaishali Thakkar &lt;vaishali.thakkar@oracle.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild</title>
<updated>2016-05-27T05:32:05+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-05-27T05:32:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6'/>
<id>dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6</id>
<content type='text'>
Pull misc kbuild updates from Michal Marek:
 "This is the non-critical part of kbuild:

   - Coccinelle fixes, one semantic patch less in this round [Vaishali
     Thakkar, Wolfram Sang, Kees Cook]

   - rpm-pkg support for (open)SUSE's update-bootloader [Jiří Kosian]

   - rpm-pkg restored support for $RPMOPTS [Srinivas Pandruvada]

   - deb-pkg fixes for the linux-headers package [Bjørn Mork, Azriel
     Samson]"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  coccicheck: Fix missing 0 index in kill loop
  scripts/package/Makefile: rpmbuild add support of RPMOPTS
  builddeb: fix missing headers in linux-headers package
  builddeb: include objtool binary in headers package
  kbuild/mkspec: support 'update-bootloader'-based systems
  scripts: coccinelle: remove check to move constants to right
  Coccinelle: setup_timer: Add space in front of parentheses
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull misc kbuild updates from Michal Marek:
 "This is the non-critical part of kbuild:

   - Coccinelle fixes, one semantic patch less in this round [Vaishali
     Thakkar, Wolfram Sang, Kees Cook]

   - rpm-pkg support for (open)SUSE's update-bootloader [Jiří Kosian]

   - rpm-pkg restored support for $RPMOPTS [Srinivas Pandruvada]

   - deb-pkg fixes for the linux-headers package [Bjørn Mork, Azriel
     Samson]"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  coccicheck: Fix missing 0 index in kill loop
  scripts/package/Makefile: rpmbuild add support of RPMOPTS
  builddeb: fix missing headers in linux-headers package
  builddeb: include objtool binary in headers package
  kbuild/mkspec: support 'update-bootloader'-based systems
  scripts: coccinelle: remove check to move constants to right
  Coccinelle: setup_timer: Add space in front of parentheses
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts: coccinelle: remove check to move constants to right</title>
<updated>2016-04-20T07:53:27+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2016-03-19T17:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f931362b38191016b7a6dc31d90a515b37658e02'/>
<id>f931362b38191016b7a6dc31d90a515b37658e02</id>
<content type='text'>
The header mentions this check depends on personal taste. I agree.
Running coccicheck on patches before I apply them, this SmPL produced
enough false positives for me that I'd rather see it removed.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The header mentions this check depends on personal taste. I agree.
Running coccicheck on patches before I apply them, this SmPL produced
enough false positives for me that I'd rather see it removed.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
