Skip to content

Commit 27374f6

Browse files
committed
binder: use Either from kernel crate
There is no need to define its own anymore as the kernel crate offers one. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
1 parent 9003f42 commit 27374f6

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

drivers/android/process.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use kernel::{
1414
sync::{Guard, Mutex, Ref, RefBorrow, UniqueRef},
1515
task::Task,
1616
user_ptr::{UserSlicePtr, UserSlicePtrReader},
17+
Either,
1718
};
1819

1920
use crate::{
@@ -23,7 +24,7 @@ use crate::{
2324
node::{Node, NodeDeath, NodeRef},
2425
range_alloc::RangeAllocator,
2526
thread::{BinderError, BinderResult, Thread},
26-
DeliverToRead, DeliverToReadListAdapter, Either,
27+
DeliverToRead, DeliverToReadListAdapter,
2728
};
2829

2930
// TODO: Review this:

drivers/android/rust_binder.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ module! {
3333
license: b"GPL",
3434
}
3535

36-
enum Either<L, R> {
37-
Left(L),
38-
Right(R),
39-
}
40-
4136
trait DeliverToRead {
4237
/// Performs work. Returns true if remaining work items in the queue should be processed
4338
/// immediately, or false if it should return to caller before processing additional work

drivers/android/thread.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use kernel::{
1414
security,
1515
sync::{CondVar, Ref, SpinLock, UniqueRef},
1616
user_ptr::{UserSlicePtr, UserSlicePtrWriter},
17+
Either,
1718
};
1819

1920
use crate::{
@@ -22,7 +23,7 @@ use crate::{
2223
process::{AllocationInfo, Process},
2324
ptr_align,
2425
transaction::{FileInfo, Transaction},
25-
DeliverCode, DeliverToRead, DeliverToReadListAdapter, Either,
26+
DeliverCode, DeliverToRead, DeliverToReadListAdapter,
2627
};
2728

2829
pub(crate) type BinderResult<T = ()> = core::result::Result<T, BinderError>;

drivers/android/transaction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use kernel::{
1010
prelude::*,
1111
sync::{Ref, SpinLock, UniqueRef},
1212
user_ptr::UserSlicePtrWriter,
13-
ScopeGuard,
13+
Either, ScopeGuard,
1414
};
1515

1616
use crate::{
@@ -19,7 +19,7 @@ use crate::{
1919
process::Process,
2020
ptr_align,
2121
thread::{BinderResult, Thread},
22-
DeliverToRead, Either,
22+
DeliverToRead,
2323
};
2424

2525
struct TransactionInner {

0 commit comments

Comments
 (0)