From: "Hui Zhu" <hui.zhu@linux.dev>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Vlastimil Babka" <vbabka@suse.cz>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
"Uladzislau Rezki" <urezki@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
bjorn3_gh@protonmail.com, "Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, vitaly.wool@konsulko.se,
"Hui Zhu" <zhuhui@kylinos.cn>,
"Geliang Tang" <geliang@kernel.org>
Subject: Re: [PATCH v6 1/2] rust: allocator: add KUnit tests for alignment guarantees
Date: Thu, 31 Jul 2025 02:54:06 +0000 [thread overview]
Message-ID: <95a767bbc1b136b1f3770965577a1072d75b8c68@linux.dev> (raw)
In-Reply-To: <CANiq72n_RnW=zma48X-txV-4AUDU9j0YGmYNBFYQ1CG3oxROJQ@mail.gmail.com>
2025年7月30日 17:16, "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com mailto:miguel.ojeda.sandonis@gmail.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@linux.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
>
next prev parent reply other threads:[~2025-07-31 2:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 3:35 [PATCH v6 0/2] rust: alloc: kvec doc example and allocator unit tests Hui Zhu
2025-07-30 3:35 ` [PATCH v6 1/2] rust: allocator: add KUnit tests for alignment guarantees Hui Zhu
2025-07-30 8:02 ` Alice Ryhl
2025-07-30 8:26 ` Kunwu Chan
2025-07-30 9:16 ` Miguel Ojeda
2025-07-31 2:54 ` Hui Zhu [this message]
2025-07-30 3:35 ` [PATCH v6 2/2] rust: alloc: kvec: add doc example for as_slice method Hui Zhu
2025-07-30 8:03 ` Alice Ryhl
2025-07-31 2:53 ` Hui Zhu
2025-07-30 8:27 ` Kunwu Chan
2025-07-30 8:31 ` Danilo Krummrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95a767bbc1b136b1f3770965577a1072d75b8c68@linux.dev \
--to=hui.zhu@linux.dev \
--cc=Liam.Howlett@oracle.com \
--cc=a.hindborg@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=geliang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=urezki@gmail.com \
--cc=vbabka@suse.cz \
--cc=vitaly.wool@konsulko.se \
--cc=zhuhui@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome