summaryrefslogtreecommitdiff
path: root/drivers/android/binder
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2025-12-09 20:50:19 +0800
committerSasha Levin <sashal@kernel.org>2026-03-04 07:19:22 -0500
commit84f9a50d5f7f75b04fb207c032015782f951ee84 (patch)
tree947058b8fb65e5597962088b388f9d33fcf925cc /drivers/android/binder
parentc89ce241c1909d2c2bdde88334c33f3000d364fb (diff)
rust_binder: Fix build failure if !CONFIG_COMPAT
commit 174e2a339bf731e080ced67c215ad609a677560b upstream. 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> Link: https://patch.msgid.link/20251209125029.1117897-1-xry111@xry111.site Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder')
-rw-r--r--drivers/android/binder/rust_binder_main.rs1
1 files changed, 1 insertions, 0 deletions
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 @@ pub static rust_binder_fops: AssertSync<kernel::bindings::file_operations> = {
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),