* [PATCH v2] rust_binder: Fix build failure if !CONFIG_COMPAT
@ 2026-02-14 13:32 Xi Ruoyao
2026-02-14 22:18 ` Miguel Ojeda
0 siblings, 1 reply; 3+ messages in thread
From: Xi Ruoyao @ 2026-02-14 13:32 UTC (permalink / raw)
To: Alice Ryhl
Cc: Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch, hev,
Xi Ruoyao, Miguel Ojeda, stable, Greg Kroah-Hartman,
Arve Hjønnevåg, Todd Kjos, Christian Brauner,
Carlos Llamas, Matt Gilbride, FUJITA Tomonori, Paul Moore,
Wedson Almeida Filho, linux-kernel
The bindgen utility cannot handle "#define compat_ptr_ioctl NULL" in the
C header, so we need to handle this case on our own.
Simply skip this field in the initializer when !CONFIG_COMPAT as the
SAFETY comment above this initializer implies this is allowed.
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://lore.kernel.org/all/CANiq72mrVzqXnAV=Hy2XBOonLHA6YQgH-ckZoc_h0VBvTGK8rA@mail.gmail.com/
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
Changes from v1: fix Miguel's mail address and add tags for stable
backport.
drivers/android/binder/rust_binder_main.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/android/binder/rust_binder_main.rs b/drivers/android/binder/rust_binder_main.rs
index 47bfb114cabb..e70f250bb4cd 100644
--- a/drivers/android/binder/rust_binder_main.rs
+++ b/drivers/android/binder/rust_binder_main.rs
@@ -312,6 +312,7 @@ unsafe impl<T> Sync for AssertSync<T> {}
owner: THIS_MODULE.as_ptr(),
poll: Some(rust_binder_poll),
unlocked_ioctl: Some(rust_binder_ioctl),
+ #[cfg(CONFIG_COMPAT)]
compat_ioctl: Some(bindings::compat_ptr_ioctl),
mmap: Some(rust_binder_mmap),
open: Some(rust_binder_open),
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] rust_binder: Fix build failure if !CONFIG_COMPAT
2026-02-14 13:32 [PATCH v2] rust_binder: Fix build failure if !CONFIG_COMPAT Xi Ruoyao
@ 2026-02-14 22:18 ` Miguel Ojeda
2026-02-15 1:45 ` Xi Ruoyao
0 siblings, 1 reply; 3+ messages in thread
From: Miguel Ojeda @ 2026-02-14 22:18 UTC (permalink / raw)
To: Xi Ruoyao
Cc: Alice Ryhl, Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch,
hev, Miguel Ojeda, stable, Greg Kroah-Hartman,
Arve Hjønnevåg, Todd Kjos, Christian Brauner,
Carlos Llamas, Matt Gilbride, FUJITA Tomonori, Paul Moore,
Wedson Almeida Filho, linux-kernel
On Sat, Feb 14, 2026 at 2:34 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> Reported-by: Miguel Ojeda <ojeda@kernel.org>
> Closes: https://lore.kernel.org/all/CANiq72mrVzqXnAV=Hy2XBOonLHA6YQgH-ckZoc_h0VBvTGK8rA@mail.gmail.com/
Hmm... Wasn't this applied as:
174e2a339bf7 ("rust_binder: Fix build failure if !CONFIG_COMPAT")
Then there was also this other thread:
https://lore.kernel.org/rust-for-linux/20260105-redefine-compat_ptr_ioctl-v1-1-25edb3d91acc@google.com/
which got applied as:
68aabb29a546 ("rust: redefine `bindings::compat_ptr_ioctl` in Rust")
Cheers,
Miguel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] rust_binder: Fix build failure if !CONFIG_COMPAT
2026-02-14 22:18 ` Miguel Ojeda
@ 2026-02-15 1:45 ` Xi Ruoyao
0 siblings, 0 replies; 3+ messages in thread
From: Xi Ruoyao @ 2026-02-15 1:45 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Alice Ryhl, Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch,
hev, Miguel Ojeda, stable, Greg Kroah-Hartman,
Arve Hjønnevåg, Todd Kjos, Christian Brauner,
Carlos Llamas, Matt Gilbride, FUJITA Tomonori, Paul Moore,
Wedson Almeida Filho, linux-kernel
On Sat, 2026-02-14 at 23:18 +0100, Miguel Ojeda wrote:
> On Sat, Feb 14, 2026 at 2:34 PM Xi Ruoyao <xry111@xry111.site> wrote:
> >
> > Reported-by: Miguel Ojeda <ojeda@kernel.org>
> > Closes:
> > https://lore.kernel.org/all/CANiq72mrVzqXnAV=Hy2XBOonLHA6YQgH-ckZoc_h0VBvTGK8rA@mail.gmail.com/
>
> Hmm... Wasn't this applied as:
>
> 174e2a339bf7 ("rust_binder: Fix build failure if !CONFIG_COMPAT")
>
> Then there was also this other thread:
>
>
> https://lore.kernel.org/rust-for-linux/20260105-redefine-compat_ptr_ioctl-v1-1-25edb3d91acc@google.com/
>
> which got applied as:
>
> 68aabb29a546 ("rust: redefine `bindings::compat_ptr_ioctl` in Rust")
Oops, just saw the mail regarding your email address yesterday when I
was archiving mails in 2025 and I thought the patch was blocked by the
issue.
Disregard this then.
--
Xi Ruoyao <xry111@xry111.site>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-15 1:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-14 13:32 [PATCH v2] rust_binder: Fix build failure if !CONFIG_COMPAT Xi Ruoyao
2026-02-14 22:18 ` Miguel Ojeda
2026-02-15 1:45 ` Xi Ruoyao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®