Skip to content

Commit c473d7a

Browse files
xry111BennoLossin
authored andcommitted
rust_binder: Fix build failure if !CONFIG_COMPAT
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>
1 parent 0f61b18 commit c473d7a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/android/binder/rust_binder_main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ pub static rust_binder_fops: AssertSync<kernel::bindings::file_operations> = {
314314
owner: THIS_MODULE.as_ptr(),
315315
poll: Some(rust_binder_poll),
316316
unlocked_ioctl: Some(rust_binder_ioctl),
317+
#[cfg(CONFIG_COMPAT)]
317318
compat_ioctl: Some(bindings::compat_ptr_ioctl),
318319
mmap: Some(rust_binder_mmap),
319320
open: Some(rust_binder_open),

0 commit comments

Comments
 (0)