[PATCH 2/5] lib/string_kunit: add test case for strnlen

Andy Shevchenko andy.shevchenko at gmail.com
Wed Jan 7 03:56:18 PST 2026


On Wed, Jan 7, 2026 at 4:35 AM Feng Jiang <jiangfeng at kylinos.cn> wrote:
>
> Add a KUnit test for strnlen() to verify correctness across
> different string lengths and memory alignments.

Same comment as per patch 1 (it would probably require to call for
arch_strnlen() or something like this).

...

> +       for (offset = 0; offset < 16; offset++) {
> +               for (len = 0; len <= 128; len++) {

You want to define these two limits to avoid the possible issues in
the future if the code gets changed.

> +       }

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-riscv mailing list