[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=H9vH=eeWHeP-xnGVcu8Ds_p8UriFiPAkefdiKg7doRA@mail.gmail.com>
Date: Sat, 21 Jun 2025 18:15:36 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Onur Özkan <work@...rozkan.dev>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
gary@...yguo.net, lossin@...nel.org, a.hindborg@...nel.org,
aliceryhl@...gle.com, tmgross@...ch.edu, dakr@...nel.org,
peterz@...radead.org, mingo@...hat.com, will@...nel.org, longman@...hat.com,
felipe_life@...e.com, daniel@...lak.dev, bjorn3_gh@...tonmail.com
Subject: Re: [PATCH 3/3 v4] add KUnit coverage on Rust `ww_mutex` implementation
On Sat, Jun 21, 2025 at 5:22 PM Onur Özkan <work@...rozkan.dev> 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
Powered by blists - more mailing lists