From: Christian Schrefl <chrisi.schrefl@gmail.com>
To: Miguel Ojeda <ojeda@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Alex Gaynor <alex.gaynor@gmail.com>
Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev
Subject: Re: [PATCH] drm: nova-drm: fix 32-bit arm build
Date: Fri, 25 Jul 2025 14:20:40 +0200 [thread overview]
Message-ID: <5b2951af-517b-4d5c-887f-417f486fd9a2@gmail.com> (raw)
In-Reply-To: <20250724165441.2105632-1-ojeda@kernel.org>
Hi Miguel,
On 24.07.25 6:54 PM, Miguel Ojeda wrote:
> In 32-bit arm, the build fails with:
>
> error[E0308]: mismatched types
> --> drivers/gpu/drm/nova/file.rs:42:28
> |
> 42 | getparam.set_value(value);
> | --------- ^^^^^ expected `u64`, found `u32`
> | |
> | arguments to this method are incorrect
> |
> note: method defined here
> --> drivers/gpu/drm/nova/uapi.rs:29:12
> |
> 29 | pub fn set_value(&self, v: u64) {
> | ^^^^^^^^^ ------
> help: you can convert a `u32` to a `u64`
> |
> 42 | getparam.set_value(value.into());
> | +++++++
>
> The reason is that `Getparam::set_value` takes a `u64` (from the UAPI),
> but `pci::Device::resource_len()` returns a `resource_size_t`, which is a
> `phys_addr_t`, which may be 32- or 64-bit.
>
> Thus add an `into()` call to support the 32-bit case, while allowing the
> Clippy lint that complains in the 64-bit case where the type is the same.
>
> Fixes: cdeaeb9dd762 ("drm: nova-drm: add initial driver skeleton")
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> As discussed, it may be best to have a newtype, or at least a function
> to perform this -- here it is the minimal fix nevertheless.
I agree we should at least have a specific conversion function, but for now:
Reviewed-by: Christian Schrefl <chrisi.schrefl@gmail.com>
Cheers Christian
next prev parent reply other threads:[~2025-07-25 12:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 16:54 [PATCH] drm: nova-drm: fix 32-bit arm build Miguel Ojeda
2025-07-24 17:05 ` Danilo Krummrich
2025-07-24 17:57 ` Miguel Ojeda
2025-07-24 20:28 ` Miguel Ojeda
2025-07-25 12:20 ` Christian Schrefl [this message]
2025-08-15 21:19 ` Danilo Krummrich
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=5b2951af-517b-4d5c-887f-417f486fd9a2@gmail.com \
--to=chrisi.schrefl@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--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).