linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Benno Lossin <benno.lossin@proton.me>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Matthew Wilcox" <willy@infradead.org>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Kees Cook" <keescook@chromium.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>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Martijn Coenen" <maco@android.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	"Carlos Llamas" <cmllamas@google.com>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org,
	"Christian Brauner" <brauner@kernel.org>
Subject: Re: [PATCH v4 4/4] rust: add abstraction for `struct page`
Date: Mon, 8 Apr 2024 09:54:40 +0200	[thread overview]
Message-ID: <CAH5fLgigLV17+6U75MC43XFnYeqtgvrrTWD7JmDSB-ebNjCVvw@mail.gmail.com> (raw)
In-Reply-To: <c130a6f5-77d7-4d9e-984d-7a8bf48ff918@proton.me>

On Sun, Apr 7, 2024 at 10:59 AM Benno Lossin <benno.lossin@proton.me> wrote:
>
> On 05.04.24 09:44, Alice Ryhl wrote:
> > On Fri, Apr 5, 2024 at 12:33 AM Benno Lossin <benno.lossin@proton.me> wrote:
> >>
> >> On 04.04.24 14:31, Alice Ryhl wrote:
> >>> +/// A bitwise shift for the page size.
> >>> +#[allow(clippy::unnecessary_cast)]
> >>
> >> Why can't you remove the cast?
> >
> > Bindgen could decide to use a different type in the future or on
> > different platforms.
>
> Did that already happen?
>
> I think that we might want to know if the type changes, since then the
> value might change?

I mean, it's quite unlikely that the page size will not fit in an
usize, even if it changes?

From bindgen's point of view, this constant is just an integer literal
with no type information. So I don't see how we can expect it to
always be generated as a usize?

Alice


  reply	other threads:[~2024-04-08  7:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 12:31 [PATCH v4 0/4] Memory management patches needed by Rust Binder Alice Ryhl
2024-04-04 12:31 ` [PATCH v4 1/4] rust: uaccess: add userspace pointers Alice Ryhl
2024-04-04 20:40   ` Benno Lossin
2024-04-04 12:31 ` [PATCH v4 2/4] uaccess: always export _copy_[from|to]_user with CONFIG_RUST Alice Ryhl
2024-04-04 12:31 ` [PATCH v4 3/4] rust: uaccess: add typed accessors for userspace pointers Alice Ryhl
2024-04-04 12:31 ` [PATCH v4 4/4] rust: add abstraction for `struct page` Alice Ryhl
2024-04-04 22:33   ` Benno Lossin
2024-04-05  7:44     ` Alice Ryhl
2024-04-07  8:58       ` Benno Lossin
2024-04-08  7:54         ` Alice Ryhl [this message]
2024-04-08  9:18           ` Miguel Ojeda
2024-04-08  9:26             ` Alice Ryhl

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=CAH5fLgigLV17+6U75MC43XFnYeqtgvrrTWD7JmDSB-ebNjCVvw@mail.gmail.com \
    --to=aliceryhl@google.com \
    --cc=a.hindborg@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.gaynor@gmail.com \
    --cc=arnd@arndb.de \
    --cc=arve@android.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cmllamas@google.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maco@android.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=tkjos@android.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wedsonaf@gmail.com \
    --cc=willy@infradead.org \
    /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