lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72n_RnW=zma48X-txV-4AUDU9j0YGmYNBFYQ1CG3oxROJQ@mail.gmail.com>
Date: Wed, 30 Jul 2025 11:16:58 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Hui Zhu <hui.zhu@...ux.dev>
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

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.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ