rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trevor Gross <tmgross@umich.edu>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: add `Module::as_ptr`
Date: Wed, 13 Mar 2024 15:09:57 -0400	[thread overview]
Message-ID: <CALNs47tj0=k7UeoKp6Myfh8tiLnJwxm3cHa4Qj2cY7sihOo9sQ@mail.gmail.com> (raw)
In-Reply-To: <20240226-module-as-ptr-v1-1-83bc89213113@google.com>

On Mon, Feb 26, 2024 at 5:13 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> This allows you to get a raw pointer to THIS_MODULE for use in unsafe
> code. The Rust Binder RFC uses it when defining fops for the binderfs
> component [1].
>
> This doesn't really need to go in now - it could go in together with
> Rust Binder like how it is sent in the Rust Binder RFC. However, the
> upcoming 1.77.0 release of the Rust compiler introduces a new warning,
> and applying this patch now will silence that warning. That allows us to
> avoid adding the #[allow(dead_code)] annotation seen in [2].
>
> Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-2-08ba9197f637@google.com/ [1]
> Link: https://lore.kernel.org/all/20240217002717.57507-1-ojeda@kernel.org/ [2]
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---

Reviewed-by: Trevor Gross <tmgross@umich.edu>

This exposes a `bindings` type to the user which we don't really do in
many other places, but it makes sense here of course.

  parent reply	other threads:[~2024-03-13 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  9:44 [PATCH] rust: add `Module::as_ptr` Alice Ryhl
2024-03-09 13:03 ` Benno Lossin
2024-03-13 19:09 ` Trevor Gross [this message]
2024-03-29 19:45 ` Miguel Ojeda

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='CALNs47tj0=k7UeoKp6Myfh8tiLnJwxm3cHa4Qj2cY7sihOo9sQ@mail.gmail.com' \
    --to=tmgross@umich.edu \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /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).