Re: [PATCH 3/3 v4] add KUnit coverage on Rust `ww_mutex` implementation
From: Miguel Ojeda
Date: Sat Jun 21 2025 - 12:16:18 EST
On Sat, Jun 21, 2025 at 5:22 PM Onur Özkan <work@xxxxxxxxxxxxx> wrote:
>
> + let guard = mutex.lock(None).unwrap();
Like in examples in docs, please try to avoid panicking if possible.
`assert*!s` are fine, though -- they are mapped especially and do not
panic.
KUnit tests now support `-> Result` too, so you can use that too,
which is also handy to write code more kernel like, e.g. to replace
things that the test is not really concerned about but that should
generally not fail like the memory allocation `unwrap()` that you have
below.
Thanks!
Cheers,
Miguel