Skip to content

Commit 42c1351

Browse files
author
Sven Van Asbroeck
committed
rust/binder: remove 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 <thesven73@gmail.com>
1 parent 19b666a commit 42c1351

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/android/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,12 +905,12 @@ impl FileOperations for Process {
905905
return Err(Error::EINVAL);
906906
}
907907

908-
if (vma.vm_flags & (bindings::VM_WRITE as u64)) != 0 {
908+
if (vma.vm_flags & (bindings::VM_WRITE as c_types::c_ulong)) != 0 {
909909
return Err(Error::EPERM);
910910
}
911911

912-
vma.vm_flags |= (bindings::VM_DONTCOPY | bindings::VM_MIXEDMAP) as u64;
913-
vma.vm_flags &= !(bindings::VM_MAYWRITE as u64);
912+
vma.vm_flags |= (bindings::VM_DONTCOPY | bindings::VM_MIXEDMAP) as c_types::c_ulong;
913+
vma.vm_flags &= !(bindings::VM_MAYWRITE as c_types::c_ulong);
914914

915915
// TODO: Set ops. We need to learn when the user unmaps so that we can stop using it.
916916
self.create_mapping(vma)

0 commit comments

Comments
 (0)