staging: android: binder: add enum usage in function arguments
Declare the binder_deferred_state enum, and use the new enum for one of the binder_defer_work function arguments. This should keep the argument within the confines of the enum instead of the whole int range. Signed-off-by: Daniel Walker <dwalker@fifo99.com> Cc: Brian Swetland <swetland@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9980318e54
commit
fd0a2f07d9
@@ -243,7 +243,7 @@ struct binder_buffer {
|
|||||||
uint8_t data[0];
|
uint8_t data[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum binder_deferred_state {
|
||||||
BINDER_DEFERRED_PUT_FILES = 0x01,
|
BINDER_DEFERRED_PUT_FILES = 0x01,
|
||||||
BINDER_DEFERRED_FLUSH = 0x02,
|
BINDER_DEFERRED_FLUSH = 0x02,
|
||||||
BINDER_DEFERRED_RELEASE = 0x04,
|
BINDER_DEFERRED_RELEASE = 0x04,
|
||||||
@@ -326,7 +326,8 @@ struct binder_transaction {
|
|||||||
uid_t sender_euid;
|
uid_t sender_euid;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void binder_defer_work(struct binder_proc *proc, int defer);
|
static void
|
||||||
|
binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* copied from get_unused_fd_flags
|
* copied from get_unused_fd_flags
|
||||||
@@ -3071,7 +3072,8 @@ static void binder_deferred_func(struct work_struct *work)
|
|||||||
}
|
}
|
||||||
static DECLARE_WORK(binder_deferred_work, binder_deferred_func);
|
static DECLARE_WORK(binder_deferred_work, binder_deferred_func);
|
||||||
|
|
||||||
static void binder_defer_work(struct binder_proc *proc, int defer)
|
static void
|
||||||
|
binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
|
||||||
{
|
{
|
||||||
mutex_lock(&binder_deferred_lock);
|
mutex_lock(&binder_deferred_lock);
|
||||||
proc->deferred_work |= defer;
|
proc->deferred_work |= defer;
|
||||||
|
Reference in New Issue
Block a user