From: Sven Van Asbroeck Date: Wed, 14 Apr 2021 20:10:09 +0000 (-0400) Subject: android: remove Rust binder dependency on 64-bit cpu architectures X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dd066e1b038128f140265347e5d0e1395c700ffd;p=users%2Fjedix%2Flinux-maple.git android: remove Rust binder dependency on 64-bit cpu architectures Remove the assumption that c_types::c_ulong is u64. This is true only on 64-bit cpu architectures. Signed-off-by: Sven Van Asbroeck [normalized title] Signed-off-by: Miguel Ojeda --- diff --git a/drivers/android/process.rs b/drivers/android/process.rs index 62ecee91e2d70..9d4d85646432c 100644 --- a/drivers/android/process.rs +++ b/drivers/android/process.rs @@ -905,12 +905,12 @@ impl FileOperations for Process { return Err(Error::EINVAL); } - if (vma.vm_flags & (bindings::VM_WRITE as u64)) != 0 { + if (vma.vm_flags & (bindings::VM_WRITE as c_types::c_ulong)) != 0 { return Err(Error::EPERM); } - vma.vm_flags |= (bindings::VM_DONTCOPY | bindings::VM_MIXEDMAP) as u64; - vma.vm_flags &= !(bindings::VM_MAYWRITE as u64); + vma.vm_flags |= (bindings::VM_DONTCOPY | bindings::VM_MIXEDMAP) as c_types::c_ulong; + vma.vm_flags &= !(bindings::VM_MAYWRITE as c_types::c_ulong); // TODO: Set ops. We need to learn when the user unmaps so that we can stop using it. self.create_mapping(vma)