* [PATCH] rust_binder: Fix build failure if !CONFIG_COMPAT
@ 2025-12-09 12:50 Xi Ruoyao
2025-12-11 1:26 ` Alice Ryhl
0 siblings, 1 reply; 3+ messages in thread
From: Xi Ruoyao @ 2025-12-09 12:50 UTC (permalink / raw)
To: Alice Ryhl
Cc: Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch, hev, Xi Ruoyao,
Miguel Ojeda, Greg Kroah-Hartman, Arve Hjønnevåg,
Todd Kjos, Christian Brauner, Carlos Llamas, Wedson Almeida Filho,
open list:ANDROID DRIVERS
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 <miguel.ojeda.sandonis@gmail.com>
Closes: https://lore.kernel.org/all/CANiq72mrVzqXnAV=Hy2XBOonLHA6YQgH-ckZoc_h0VBvTGK8rA@mail.gmail.com/
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
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 c79a9e742240..9a527268f5b4 100644
--- a/drivers/android/binder/rust_binder_main.rs
+++ b/drivers/android/binder/rust_binder_main.rs
@@ -314,6 +314,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.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rust_binder: Fix build failure if !CONFIG_COMPAT
2025-12-09 12:50 [PATCH] rust_binder: Fix build failure if !CONFIG_COMPAT Xi Ruoyao
@ 2025-12-11 1:26 ` Alice Ryhl
2025-12-27 12:35 ` Alice Ryhl
0 siblings, 1 reply; 3+ messages in thread
From: Alice Ryhl @ 2025-12-11 1:26 UTC (permalink / raw)
To: Xi Ruoyao
Cc: Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch, hev,
Miguel Ojeda, Greg Kroah-Hartman, Arve Hjønnevåg,
Todd Kjos, Christian Brauner, Carlos Llamas, Wedson Almeida Filho,
open list:ANDROID DRIVERS
On Tue, Dec 09, 2025 at 08:50:19PM +0800, Xi Ruoyao wrote:
> 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 <miguel.ojeda.sandonis@gmail.com>
> Closes: https://lore.kernel.org/all/CANiq72mrVzqXnAV=Hy2XBOonLHA6YQgH-ckZoc_h0VBvTGK8rA@mail.gmail.com/
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rust_binder: Fix build failure if !CONFIG_COMPAT
2025-12-11 1:26 ` Alice Ryhl
@ 2025-12-27 12:35 ` Alice Ryhl
0 siblings, 0 replies; 3+ messages in thread
From: Alice Ryhl @ 2025-12-27 12:35 UTC (permalink / raw)
To: Xi Ruoyao
Cc: Huacai Chen, WANG Xuerui, Mingcong Bai, loongarch, hev,
Miguel Ojeda, Greg Kroah-Hartman, Arve Hjønnevåg,
Todd Kjos, Christian Brauner, Carlos Llamas, Wedson Almeida Filho,
open list:ANDROID DRIVERS
On Thu, Dec 11, 2025 at 2:26 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> On Tue, Dec 09, 2025 at 08:50:19PM +0800, Xi Ruoyao wrote:
> > 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 <miguel.ojeda.sandonis@gmail.com>
this should use Miguel's kernel.org email address for the Reported-by tag.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-27 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 12:50 [PATCH] rust_binder: Fix build failure if !CONFIG_COMPAT Xi Ruoyao
2025-12-11 1:26 ` Alice Ryhl
2025-12-27 12:35 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox