<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/coccinelle/api, branch v5.9</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.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-08-04T20:46:59Z</updated>
<entry>
<title>coccinelle: api: filter out memdup_user definitions</title>
<updated>2020-08-04T20:46:59Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-07-20T16:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d05f94ad28c76cbd98aecee8e617f18454050f57'/>
<id>urn:sha1:d05f94ad28c76cbd98aecee8e617f18454050f57</id>
<content type='text'>
Don't match memdup_user/vmemdup_user.

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: api: extend memdup_user rule with vmemdup_user()</title>
<updated>2020-08-04T20:46:59Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-07-20T16:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c568dbd677bcfc975220d3157c89c48669a23e3'/>
<id>urn:sha1:9c568dbd677bcfc975220d3157c89c48669a23e3</id>
<content type='text'>
Add vmemdup_user() transformations to the memdup_user.cocci rule.
Commit 50fd2f298bef ("new primitive: vmemdup_user()") introduced
vmemdup_user(). The function uses kvmalloc with GPF_USER flag.

Signed-off-by: Denis Efremov &lt;efremov@linux.com&gt;
</content>
</entry>
<entry>
<title>coccinelle: api: extend memdup_user transformation with GFP_USER</title>
<updated>2020-08-04T20:46:59Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-07-20T16:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=547ade42ced037db77a82e67d70b55c0eecc49e0'/>
<id>urn:sha1:547ade42ced037db77a82e67d70b55c0eecc49e0</id>
<content type='text'>
Match GFP_USER and optional __GFP_NOWARN allocations with
memdup_user.cocci rule.
Commit 6c2c97a24f09 ("memdup_user(): switch to GFP_USER") switched
memdup_user() from GFP_KERNEL to GFP_USER. In almost all cases it
is still a good idea to recommend memdup_user() for GFP_KERNEL
allocations. The motivation behind altering memdup_user() to GFP_USER:
https://lkml.org/lkml/2018/1/6/333

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: api: add kzfree script</title>
<updated>2020-08-04T20:46:59Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-07-17T11:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7cf4be68b177855b620dbc045bf26606eed197ac'/>
<id>urn:sha1:7cf4be68b177855b620dbc045bf26606eed197ac</id>
<content type='text'>
Check for memset()/memzero_explicit() followed by kfree()/vfree()/kvfree().

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: api/kstrdup: fix coccinelle position</title>
<updated>2020-08-04T20:46:58Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-06-19T13:23:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2fbecb7dfefdbe8250a86f92bb81d87deebc0488'/>
<id>urn:sha1:2fbecb7dfefdbe8250a86f92bb81d87deebc0488</id>
<content type='text'>
There is a typo in rule r2. Position p1 should be attached to kzalloc()
call.

Fixes: 29a36d4dec6c ("scripts/coccinelle: improve the coverage of some semantic patches")
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: api: add device_attr_show script</title>
<updated>2020-08-04T20:46:58Z</updated>
<author>
<name>Denis Efremov</name>
<email>efremov@linux.com</email>
</author>
<published>2020-06-15T13:02:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abfc19ff202d287742483e15fd478ddd6ada2187'/>
<id>urn:sha1:abfc19ff202d287742483e15fd478ddd6ada2187</id>
<content type='text'>
According to the documentation[1] show() methods of device attributes
should return the number of bytes printed into the buffer. This is
the return value of scnprintf(). show() must not use snprintf()
when formatting the value to be returned to user space. snprintf()
returns the length the resulting string would be, assuming it all
fit into the destination array[2]. scnprintf() return the length of
the string actually created in buf. If one can guarantee that an
overflow will never happen sprintf() can be used otherwise scnprintf().

[1] Documentation/filesystems/sysfs.txt
[2] "snprintf() confusion" https://lwn.net/Articles/69419/

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: api/devm_platform_ioremap_resource: remove useless script</title>
<updated>2019-10-17T16:05:56Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2019-10-17T14:22:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=283ea345934d277e30c841c577e0e2142b4bfcae'/>
<id>urn:sha1:283ea345934d277e30c841c577e0e2142b4bfcae</id>
<content type='text'>
While it is useful for new drivers to use devm_platform_ioremap_resource,
this script is currently used to spam maintainers, often updating very
old drivers.  The net benefit is the removal of 2 lines of code in the
driver but the review load for the maintainers is huge.  As of now, more
that 560 patches have been sent, some of them obviously broken, as in:

 https://lore.kernel.org/lkml/9bbcce19c777583815c92ce3c2ff2586@www.loen.fr/

Remove the script to reduce the spam.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Acked-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2019-09-18T17:04:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-09-18T17:04:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f7d290a7275edb270dbee13212c37cb59940221'/>
<id>urn:sha1:1f7d290a7275edb270dbee13212c37cb59940221</id>
<content type='text'>
Pull driver core updates from Greg Kroah-Hartman:
 "Here is the big driver core update for 5.4-rc1.

  There was a bit of a churn in here, with a number of core and OF
  platform patches being added to the tree, and then after much
  discussion and review and a day-long in-person meeting, they were
  decided to be reverted and a new set of patches is currently being
  reviewed on the mailing list.

  Other than that churn, there are two "persistent" branches in here
  that other trees will be pulling in as well during the merge window.
  One branch to add support for drivers to have the driver core
  automatically add sysfs attribute files when a driver is bound to a
  device so that the driver doesn't have to manually do it (and then
  clean it up, as it always gets it wrong).

  There's another branch in here for generic lookup helpers for the
  driver core that lots of busses are starting to use. That's the
  majority of the non-driver-core changes in this patch series.

  There's also some on-going debugfs file creation cleanup that has been
  slowly happening over the past few releases, with the goal to
  hopefully get that done sometime next year.

  All of these have been in linux-next for a while now with no reported
  issues"

[ Note that the above-mentioned generic lookup helpers branch was
  already brought in by the LED merge (commit 4feaab05dc1e) that had
  shared it.

  Also note that that common branch introduced an i2c bug due to a bad
  conversion, which got fixed here. - Linus ]

* tag 'driver-core-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (49 commits)
  coccinelle: platform_get_irq: Fix parse error
  driver-core: add include guard to linux/container.h
  sysfs: add BIN_ATTR_WO() macro
  driver core: platform: Export platform_get_irq_optional()
  hwmon: pwm-fan: Use platform_get_irq_optional()
  driver core: platform: Introduce platform_get_irq_optional()
  Revert "driver core: Add support for linking devices during device addition"
  Revert "driver core: Add edit_links() callback for drivers"
  Revert "of/platform: Add functional dependency link from DT bindings"
  Revert "driver core: Add sync_state driver/bus callback"
  Revert "of/platform: Pause/resume sync state during init and of_platform_populate()"
  Revert "of/platform: Create device links for all child-supplier depencencies"
  Revert "of/platform: Don't create device links for default busses"
  Revert "of/platform: Fix fn definitons for of_link_is_valid() and of_link_property()"
  Revert "of/platform: Fix device_links_supplier_sync_state_resume() warning"
  Revert "of/platform: Disable generic device linking code for PowerPC"
  devcoredump: fix typo in comment
  devcoredump: use memory_read_from_buffer
  of/platform: Disable generic device linking code for PowerPC
  device.h: Fix warnings for mismatched parameter names in comments
  ...
</content>
</entry>
<entry>
<title>coccinelle: platform_get_irq: Fix parse error</title>
<updated>2019-09-06T08:10:28Z</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2019-09-06T03:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca7ce5a2710ad2a57bf7d0c4c712590bb69a5e1c'/>
<id>urn:sha1:ca7ce5a2710ad2a57bf7d0c4c712590bb69a5e1c</id>
<content type='text'>
When do coccicheck, I get this error:

spatch -D report --no-show-diff --very-quiet --cocci-file
./scripts/coccinelle/api/platform_get_irq.cocci --include-headers
--dir . -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include
 -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi
 -I ./include/uapi -I ./include/generated/uapi
 --include ./include/linux/kconfig.h --jobs 192 --chunksize 1
minus: parse error:
  File "./scripts/coccinelle/api/platform_get_irq.cocci", line 24, column 9, charpos = 355
  around = '\(',
  whole content = if ( ret \( &lt; \| &lt;= \) 0 )

In commit e56476897448 ("fpga: Remove dev_err() usage
after platform_get_irq()") log, I found the semantic patch,
it fix this issue.

Fixes: 98051ba2b28b ("coccinelle: Add script to check for platform_get_irq() excessive prints")
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Link: https://lore.kernel.org/r/20190906033006.17616-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>coccinelle: api/atomic_as_refcounter: add SPDX License Identifier</title>
<updated>2019-07-30T16:34:15Z</updated>
<author>
<name>Matthias Maennich</name>
<email>maennich@google.com</email>
</author>
<published>2019-07-25T10:17:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef349abd91c1b37f87639170bcd9d11fe3ac58ff'/>
<id>urn:sha1:ef349abd91c1b37f87639170bcd9d11fe3ac58ff</id>
<content type='text'>
Add the missing GPLv2 SPDX license identifier.

It appears this single file was missing from 7f904d7e1f3e ("treewide:
Replace GPLv2 boilerplate/reference with SPDX - rule 505"), which
addressed all other files in scripts/coccinelle. Hence I added
GPL-2.0-only consitently with the mentioned patch.

Cc: linux-spdx@vger.kernel.org
Cc: Elena Reshetova &lt;elena.reshetova@intel.com&gt;
Signed-off-by: Matthias Maennich &lt;maennich@google.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
