<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/dummy/iio_simple_dummy_buffer.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-22T01:09:51Z</updated>
<entry>
<title>Convert 'alloc_obj' family to use the new default GFP_KERNEL argument</title>
<updated>2026-02-22T01:09:51Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2026-02-22T00:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43'/>
<id>urn:sha1:bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43</id>
<content type='text'>
This was done entirely with mindless brute force, using

    git grep -l '\&lt;k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2026-02-21T07:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: dummy: Switch to iio_push_to_buffers_with_ts() and provide size of storage</title>
<updated>2025-05-21T13:20:26Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2025-04-13T10:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d1168263bcb84c38f3475f2336b30ede4235ae1'/>
<id>urn:sha1:2d1168263bcb84c38f3475f2336b30ede4235ae1</id>
<content type='text'>
Provide the storage size so that the helper can sanity check that it
is large enough for the configured channels.

Reviewed-by: Nuno Sá &lt;nuno.sa@analog.com&gt;
Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://patch.msgid.link/20250413103443.2420727-8-jic23@kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: dummy: Use a fixed structure to build up scan to push to buffers.</title>
<updated>2025-05-21T13:20:26Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2025-04-13T10:34:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fda643a9530c86e503a90791392443cd47f3c997'/>
<id>urn:sha1:fda643a9530c86e503a90791392443cd47f3c997</id>
<content type='text'>
It has long been discouraged for drivers to make use of iio_dev-&gt;scan_bytes
directly as that is an implementation detail of the core. As such our
example driver should definitely not be doing so.

In order to illustrate the more complex case, where a DMA safe buffer is
needed, continue to kzalloc() the storage (but with a structure definition
to provide an explicit data layout). Also add comments on when a DMA safe
buffer is necessary and the two common ways of obtaining one.

Whilst we have a mixture of signed and unsigned channels, the unsigned
channels have ranges that can be stored in a signed value - hence
use signed storage for all channels, simplifying the structure definition.

Reviewed-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://patch.msgid.link/20250413103443.2420727-7-jic23@kernel.org
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: dummy: iio_simply_dummy_buffer: fix information leak in triggered buffer</title>
<updated>2024-12-07T17:23:41Z</updated>
<author>
<name>Javier Carrasco</name>
</author>
<published>2024-11-25T21:16:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=333be433ee908a53f283beb95585dfc14c8ffb46'/>
<id>urn:sha1:333be433ee908a53f283beb95585dfc14c8ffb46</id>
<content type='text'>
The 'data' array is allocated via kmalloc() and it is used to push data
to user space from a triggered buffer, but it does not set values for
inactive channels, as it only uses iio_for_each_active_channel()
to assign new values.

Use kzalloc for the memory allocation to avoid pushing uninitialized
information to userspace.

Cc: stable@vger.kernel.org
Fixes: 415f79244757 ("iio: Move IIO Dummy Driver out of staging")
Signed-off-by: Javier Carrasco &lt;javier.carrasco.cruz@gmail.com&gt;
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-9-0cb6e98d895c@gmail.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: dummy: iio_simple_dummy_buffer: use iio_for_each_active_channel()</title>
<updated>2024-08-03T09:13:39Z</updated>
<author>
<name>Nuno Sa</name>
</author>
<published>2024-07-18T13:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05552370dd3f3a67147fbcec612c1fdd36370772'/>
<id>urn:sha1:05552370dd3f3a67147fbcec612c1fdd36370772</id>
<content type='text'>
Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.

Signed-off-by: Nuno Sa &lt;nuno.sa@analog.com&gt;
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-4-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: fix opencoded for_each_set_bit()</title>
<updated>2022-05-02T13:30:39Z</updated>
<author>
<name>Yury Norov</name>
</author>
<published>2022-02-09T18:28:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8f14e2b737f8d3136f1012e67af99239bb30850'/>
<id>urn:sha1:c8f14e2b737f8d3136f1012e67af99239bb30850</id>
<content type='text'>
iio_simple_dummy_trigger_h() is mostly an opencoded for_each_set_bit().
Using for_each_set_bit() make code much cleaner, and more effective.

Signed-off-by: Yury Norov &lt;yury.norov@gmail.com&gt;
</content>
</entry>
<entry>
<title>iio:dummy: Drop set but unused variable len.</title>
<updated>2021-12-21T15:10:09Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2021-11-28T17:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8ffca613cd8dfc27adbfc6cee08b659abed3d88'/>
<id>urn:sha1:e8ffca613cd8dfc27adbfc6cee08b659abed3d88</id>
<content type='text'>
Not sure what the thinking was here, as lost to history, but the
variable is clearly not used so get rid of it.

Warning seen with clang W=1 tests (may be present with other compilers
and build options).

Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/20211128172445.2616166-11-jic23@kernel.org
</content>
</entry>
<entry>
<title>iio: dummy: iio_simple_dummy_buffer: use triggered buffer core calls</title>
<updated>2021-03-11T20:47:05Z</updated>
<author>
<name>Alexandru Ardelean</name>
</author>
<published>2021-02-15T10:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=738f6ba1180046904402ffbe210fbd2fa2c4b050'/>
<id>urn:sha1:738f6ba1180046904402ffbe210fbd2fa2c4b050</id>
<content type='text'>
The iio_simple_dummy_configure_buffer() function is essentially a
re-implementation of the iio_triggered_buffer_setup() function.

This change makes use of the iio_triggered_buffer_setup() function. The
reason is so that we don't have to modify the iio_device_attach_buffer()
function in this driver as well.

One minor drawback is that the pollfunc name may not be 100% identical
with the one in the original code, but since it's an example, it should be
a big problem.

This change does a minor re-arranging of the included iio headers, as a
minor tidy-up.

Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Link: https://lore.kernel.org/r/20210215104043.91251-19-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: dummy: iio_simple_dummy_buffer: Demote file header and correct misspelling</title>
<updated>2020-07-20T08:02:58Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-07-16T13:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd2e16cf482d98ab2dd938f08d79d9f6d869730f'/>
<id>urn:sha1:dd2e16cf482d98ab2dd938f08d79d9f6d869730f</id>
<content type='text'>
File headers are not good candidates for kerneldoc.

Fixes the following W=1 kernel build warning(s):

 drivers/iio/dummy/iio_simple_dummy_buffer.c:27: warning: cannot understand function prototype: 'const s16 fakedata[] = '
 drivers/iio/dummy/iio_simple_dummy_buffer.c:185: warning: Function parameter or member 'indio_dev' not described in 'iio_simple_dummy_unconfigure_buffer'
 drivers/iio/dummy/iio_simple_dummy_buffer.c:185: warning: Excess function parameter 'indo_dev' description in 'iio_simple_dummy_unconfigure_buffer'

Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
