rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Wedson Almeida Filho <wedsonaf@gmail.com>
Cc: Antonio Hickey <antoniohickey99@gmail.com>,
	ojeda@kernel.org, alex.gaynor@gmail.com,  boqun.feng@gmail.com,
	gary@garyguo.net, bjorn3_gh@protonmail.com,
	 benno.lossin@proton.me, a.hindborg@samsung.com,
	 rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust: task: add `as_raw()` to `Task`
Date: Tue, 16 Jan 2024 09:53:52 +0100	[thread overview]
Message-ID: <CAH5fLgjdNbZRzHopyLP7ssrvfDK-tFFjhGv2aQe86brQWDJK+Q@mail.gmail.com> (raw)
In-Reply-To: <CANeycqpk77REoVvmdM-Lbb=rW0kyW7kNFfj_wRYto9G+qzaAmA@mail.gmail.com>

On Tue, Jan 16, 2024 at 8:29 AM Wedson Almeida Filho <wedsonaf@gmail.com> wrote:
>
> On Mon, 15 Jan 2024 at 23:29, Antonio Hickey <antoniohickey99@gmail.com> wrote:
> > +    /// Returns a raw pointer to the underlying C task struct.
> > +    pub fn as_raw(&self) -> *mut bindings::task_struct {
> > +        self.0.get()
> > +    }
> > +
>
> Note that the wrapped `bindings::task_struct` in `Task` was
> `pub(crate)`, but you're making `as_raw` fully public.
>
> We don't want  modules to use the definitions in `bindings` (only
> subsystems). So I'd suggest limiting `as_raw` to `pub(crate)`.

I don't agree that this policy should be so tight as to prevent
conversions to/from raw pointers from being public. I need some such
conversions in Rust Binder to interface with binderfs.

Alice

  reply	other threads:[~2024-01-16  8:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  2:28 [PATCH] rust: task: add `as_raw()` to `Task` Antonio Hickey
2024-01-16  2:28 ` [PATCH] rust: task: use safe `current!` macro Antonio Hickey
2024-01-16  8:57   ` Alice Ryhl
2024-01-16  7:20 ` [PATCH] rust: task: add `as_raw()` to `Task` Greg KH
2024-01-16  7:29 ` Wedson Almeida Filho
2024-01-16  8:53   ` Alice Ryhl [this message]
2024-01-16 18:24 ` Boqun Feng
2024-01-16 19:03   ` 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=CAH5fLgjdNbZRzHopyLP7ssrvfDK-tFFjhGv2aQe86brQWDJK+Q@mail.gmail.com \
    --to=aliceryhl@google.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=antoniohickey99@gmail.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --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).