From: Benno Lossin <benno.lossin@proton.me>
To: Boqun Feng <boqun.feng@gmail.com>,
Antonio Hickey <contact@antoniohickey.com>
Cc: "Andreas Hindborg" <a.hindborg@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Brendan Higgins" <brendan.higgins@linux.dev>,
"David Gow" <davidgow@google.com>, "Rae Moar" <rmoar@google.com>,
"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com, netdev@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v3 2/3] rust: replace `addr_of[_mut]!` with `&raw [mut]`
Date: Sat, 15 Mar 2025 09:47:51 +0000 [thread overview]
Message-ID: <D8GQTTOG3YEA.L56HVS2ZWZMK@proton.me> (raw)
In-Reply-To: <67d4c889.050a0220.35d7ce.b4b0@mx.google.com>
On Sat Mar 15, 2025 at 1:23 AM CET, Boqun Feng wrote:
> On Fri, Mar 14, 2025 at 11:41:55PM +0000, Antonio Hickey wrote:
> [...]
>> @@ -541,7 +541,7 @@ macro_rules! stack_try_pin_init {
>> ///
>> /// ```rust
>> /// # use kernel::{macros::{Zeroable, pin_data}, pin_init};
>> -/// # use core::{ptr::addr_of_mut, marker::PhantomPinned};
>> +/// # use core::marker::PhantomPinned;
>> /// #[pin_data]
>> /// #[derive(Zeroable)]
>> /// struct Buf {
>> @@ -554,7 +554,7 @@ macro_rules! stack_try_pin_init {
>> /// pin_init!(&this in Buf {
>> /// buf: [0; 64],
>> /// // SAFETY: TODO.
>> -/// ptr: unsafe { addr_of_mut!((*this.as_ptr()).buf).cast() },
>> +/// ptr: unsafe { &raw mut (*this.as_ptr()).buf.cast() },
>
> This should be:
>
>
> /// ptr: unsafe { &raw mut ((*this.as_ptr()).buf).cast() },
>
> , right?
I'd say it has to be `ptr: unsafe { (&raw mut ((*this.as_ptr()).buf)).cast() }
---
Cheers,
Benno
next prev parent reply other threads:[~2025-03-15 9:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250314234148.599196-1-contact@antoniohickey.com>
2025-03-14 23:41 ` [PATCH v3 2/3] rust: replace `addr_of[_mut]!` with `&raw [mut]` Antonio Hickey
2025-03-15 0:18 ` Boqun Feng
2025-03-16 2:57 ` Antonio Hickey
2025-03-16 4:15 ` Boqun Feng
2025-03-15 0:23 ` Boqun Feng
2025-03-15 9:47 ` Benno Lossin [this message]
2025-03-15 12:42 ` Boqun Feng
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=D8GQTTOG3YEA.L56HVS2ZWZMK@proton.me \
--to=benno.lossin@proton.me \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bhelgaas@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=brendan.higgins@linux.dev \
--cc=contact@antoniohickey.com \
--cc=dakr@kernel.org \
--cc=davidgow@google.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rmoar@google.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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;
as well as URLs for NNTP newsgroup(s).