[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <95a767bbc1b136b1f3770965577a1072d75b8c68@linux.dev>
Date: Thu, 31 Jul 2025 02:54:06 +0000
From: "Hui Zhu" <hui.zhu@...ux.dev>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com>
Cc: "Danilo Krummrich" <dakr@...nel.org>, "Lorenzo Stoakes"
<lorenzo.stoakes@...cle.com>, "Vlastimil Babka" <vbabka@...e.cz>, "Liam R
. Howlett" <Liam.Howlett@...cle.com>, "Uladzislau Rezki"
<urezki@...il.com>, "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor"
<alex.gaynor@...il.com>, "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo"
<gary@...yguo.net>, bjorn3_gh@...tonmail.com, "Benno Lossin"
<lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Alice
Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, vitaly.wool@...sulko.se, "Hui Zhu"
<zhuhui@...inos.cn>, "Geliang Tang" <geliang@...nel.org>
Subject: Re: [PATCH v6 1/2] rust: allocator: add KUnit tests for alignment
guarantees
2025年7月30日 17:16, "Miguel Ojeda" <miguel.ojeda.sandonis@...il.com mailto:miguel.ojeda.sandonis@...il.com?to=%22Miguel%20Ojeda%22%20%3Cmiguel.ojeda.sandonis%40gmail.com%3E > 写到:
>
> On Wed, Jul 30, 2025 at 5:37 AM Hui Zhu <hui.zhu@...ux.dev> wrote:
>
> >
> > +#[macros::kunit_tests(rust_allocator_kunit)]
> >
> Is there any reason for the `_kunit` suffix? If not, then we should
> avoid suffixing `_kunit` to every suite name.
>
> I see we already have `rust_kernel_kunit`, but that one is because it
> is the KUnit file itself.
>
> There is also `rust_kvec_kunit`, but we should clean that one up.
>
> >
> > + fn test_alignment() -> Result<()> {
> >
> `-> Result` since the prelude is available.
>
> >
> > + fn alignment_valid(&self, align: usize) -> bool {
> >
> We typically prefix these with `is_`.
>
> I would also call it `is_aligned_to`, to match the upstream Rust one,
> which we could perhaps use if it becomes stable.
>
Hi Miguel,
I sent the v7 version according to your comments.
Thanks,
Hui
> Cheers,
> Miguel
>
Powered by blists - more mailing lists