[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72nDY_ZOk7=1MX3RQqzscaXayAm2XkaeQ0UTke-kdy1fnA@mail.gmail.com>
Date: Thu, 31 Jul 2025 13:42:42 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Ritvik Gupta <ritvikfoss@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <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>,
Danilo Krummrich <dakr@...nel.org>, skhan@...uxfoundation.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v3] rust: kernel: introduce `unsafe_precondition_assert!` macro
On Thu, Jul 31, 2025 at 1:12 PM Ritvik Gupta <ritvikfoss@...il.com> wrote:
>
> +/// /// - `buf` must be non-null.
> +/// /// - `buf` must be 16-byte aligned.
We don't know since the full body is not shown, but it is likely this
would need to also be a valid pointer, i.e. it may be an uncommon
example.
Perhaps we could show one of the conditional cases, i.e. the "if `buf`
is non-null, then it must be valid." cases. That could also be a nice
excuse to also introduce an `implies()` function if an example allows
for it. But we can do that later on, no worries.
More importantly, could we have a user of the macro introduced in a
second patch so that it gets already used?
Thanks for the patch!
Cheers,
Miguel
Powered by blists - more mailing lists