Re: [PATCH v3 2/3] rust: kunit: add 'kunit_suite.status' binding to 'kunit_unsafe_test_suite'
From: David Gow
Date: Sat Jun 20 2026 - 07:08:39 EST
Le 17/06/2026 à 8:15 PM, Vaibhav Jain a écrit :
> Update KUnit Rust binding macro-rule 'kunit_unsafe_test_suite' to add and
> initialize the newly introduced 'kunit_suite.status'. Without this
> 'kunit_suite.status' field is never initialized which is an error for the
> Rust compiler.
>
> Suggested-by: David Gow <david@xxxxxxxxxxxx>
> Signed-off-by: Vaibhav Jain <vaibhav@xxxxxxxxxxxxx>
> ---
> Changelog
> =========
> V2->V3:
> Patch, not present in earlier version
> ---
Thanks very much. I'd prefer it if this could be squashed into patch 1,
just so we don't have a period where the rust build is broken.
Otherwise, good, though. With the formatting issue below fixed, this is
Reviewed-by: David Gow <david@xxxxxxxxxxxx>
> rust/kernel/kunit.rs | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs
> index a1edf7491579..e07894c72d0d 100644
> --- a/rust/kernel/kunit.rs
> +++ b/rust/kernel/kunit.rs
> @@ -288,6 +288,7 @@ macro_rules! kunit_unsafe_test_suite {
> log: ::core::ptr::null_mut(),
> suite_init_err: 0,
> is_init: false,
> + status: kernel::bindings::kunit_status_KUNIT_SUCCESS,
Alas, Rust code needs to be indented with four spaces, rather than tabs.
In theory, make LLVM=1 rustfmtcheck is supposed to catch this, but it's
not working for me.
> };
>
> #[used(compiler)]
Cheers,
-- David