From: Jonathan Cameron <jic23@kernel.org>
To: Raffaele Tranfaglia via B4 Relay
<devnull+raffaele.tranfaglia.gmail.com@kernel.org>
Cc: raffaele.tranfaglia@gmail.com,
"Rodrigo Alencar" <rodrigo.alencar@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Andy Shevchenko" <andriy.shevchenko@intel.com>
Subject: Re: [PATCH v3 0/2] iio: test: iio-test-format: char format test and overrun checks
Date: Sat, 7 Nov 2026 22:55:04 +0000 [thread overview]
Message-ID: <20261107225504.46217911@jic23-hlaptop> (raw)
In-Reply-To: <20261103-iio-test-format-char-v3-0-d44074ecca70@gmail.com>
On Tue, 03 Nov 2026 21:17:06 +0000
Raffaele Tranfaglia via B4 Relay <devnull+raffaele.tranfaglia.gmail.com@kernel.org> wrote:
> Add a KUnit test for IIO_VAL_CHAR formatting and, as suggested by
> Andy, make IIO_TEST_FORMAT_EXPECT_EQ() check that iio_format_value()
> does not write past the formatted string.
>
> A NUL character is currently emitted as is, so the attribute reads
> back as "\0\n". The test documents this behaviour; please let me
> know if it should rather be rejected or handled differently.
>
> These patches were written with the help of an LLM-based coding
> assistant, which I used to draft the code and commit messages. I
> reviewed and tested all changes myself.
>
> Tested with KUnit on arm64 QEMU.
>
> Signed-off-by: Raffaele Tranfaglia <raffaele.tranfaglia@gmail.com>
LGTM. I'll apply this to the testing branch of iio.git.
Still time for more review and potentially tags though as I'll
probably not push that out as togreg (which linux-next picks up
and which is supposed to be more or less non rebasing) until mid
week.
Thanks,
Jonathan
> ---
> Changes in v3:
> - Reformat IIO_TEST_FORMAT_EXPECT_EQ() and use a local variable for
> the size (Andy)
> - Link to v2: https://patch.msgid.link/20261102-iio-test-format-char-v2-0-926100689e62@gmail.com
>
> Changes in v2:
> - Drop the Assisted-by tag and describe the tool use here (Andy)
> - New patch 1: poison the buffer and check that nothing is written
> past the string (Andy)
> - Add special, non-printable, NUL and out-of-range cases (Andy)
> - Link to v1: https://patch.msgid.link/20261025-iio-test-format-char-v1-1-e2c208f90e87@gmail.com
>
> ---
> Raffaele Tranfaglia (2):
> iio: test: iio-test-format: check that nothing is written past the string
> iio: test: iio-test-format: add test case for char format
>
> drivers/iio/test/iio-test-format.c | 121 +++++++++++++++++++++++++++++++------
> 1 file changed, 103 insertions(+), 18 deletions(-)
> ---
> base-commit: d1425b382b9cc5bd19223fad8ba4a8af3dbe1305
> change-id: 20261025-iio-test-format-char-8a17fbf9a201
>
> Best regards,
> --
> Raffaele Tranfaglia <raffaele.tranfaglia@gmail.com>
>
>
prev parent reply other threads:[~2026-11-07 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 21:17 Raffaele Tranfaglia via B4 Relay
2026-11-03 21:17 ` [PATCH v3 1/2] iio: test: iio-test-format: check that nothing is written past the string Raffaele Tranfaglia via B4 Relay
2026-11-03 21:17 ` [PATCH v3 2/2] iio: test: iio-test-format: add test case for char format Raffaele Tranfaglia via B4 Relay
2026-11-07 22:55 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261107225504.46217911@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=devnull+raffaele.tranfaglia.gmail.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=raffaele.tranfaglia@gmail.com \
--cc=rodrigo.alencar@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®