All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: 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>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"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: Fri, 14 Mar 2025 17:23:33 -0700	[thread overview]
Message-ID: <67d4c889.050a0220.35d7ce.b4b0@mx.google.com> (raw)
In-Reply-To: <0100019597092d67-0da59c6d-9680-413f-bbce-109ef95724cc-000000@email.amazonses.com>

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?

Regards,
Boqun

>  ///     pin: PhantomPinned,
>  /// });
>  /// pin_init!(Buf {
[...]

  parent reply	other threads:[~2025-03-15  0:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250314234148.599196-1-contact@antoniohickey.com>
2025-03-14 23:41 ` [PATCH v3 1/3] rust: enable `raw_ref_op` feature Antonio Hickey
2025-03-15  9:58   ` Benno Lossin
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 [this message]
2025-03-15  9:47     ` Benno Lossin
2025-03-15 12:42       ` Boqun Feng
2025-03-14 23:41 ` [PATCH v3 3/3] rust: clippy: disable `addr_of!` and `addr_of_mut` macros Antonio Hickey

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=67d4c889.050a0220.35d7ce.b4b0@mx.google.com \
    --to=boqun.feng@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.