]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
android: remove Rust binder dependency on 64-bit cpu architectures
authorSven Van Asbroeck <thesven73@gmail.com>
Wed, 14 Apr 2021 20:10:09 +0000 (16:10 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 27 Apr 2021 03:06:13 +0000 (05:06 +0200)
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 <thesven73@gmail.com>
[normalized title]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
drivers/android/process.rs

index 62ecee91e2d70dc4350060478033feaca4540a8b..9d4d85646432cfdefd743e002a68bec1b965b466 100644 (file)
@@ -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)