All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] staging: android: binder: Remove some funny && usage
@ 2009-06-12 18:51 Daniel Walker
  2009-06-12 18:51 ` [PATCH 2/6] staging: android: binder: move debugging mask into a macro Daniel Walker
  2009-06-16 20:46 ` [PATCH 1/6] staging: android: binder: Remove some funny && usage Jeremy Fitzhardinge
  0 siblings, 2 replies; 38+ messages in thread
From: Daniel Walker @ 2009-06-12 18:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Brian Swetland, linux-kernel, Daniel Walker

This && usage is a bit confusing. I reworked these to be actual
if statements so it's clear what is going on.

Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
 drivers/staging/android/binder.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 17d89a8..c37336d 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2146,7 +2146,7 @@ static int binder_thread_read(struct binder_proc *proc,
 	void __user *end = buffer + size;
 
 	int ret = 0;
-	int wait_for_proc_work;
+	int wait_for_proc_work = 0;
 
 	if (*consumed == 0) {
 		if (put_user(BR_NOOP, (uint32_t __user *)ptr))
@@ -2155,8 +2155,8 @@ static int binder_thread_read(struct binder_proc *proc,
 	}
 
 retry:
-	wait_for_proc_work = thread->transaction_stack == NULL &&
-				list_empty(&thread->todo);
+	if (list_empty(&thread->todo) && thread->transaction_stack == NULL)
+		wait_for_proc_work = 1;
 
 	if (thread->return_error != BR_OK && ptr < end) {
 		if (thread->return_error2 != BR_OK) {
@@ -2539,13 +2539,15 @@ static unsigned int binder_poll(struct file *filp,
 {
 	struct binder_proc *proc = filp->private_data;
 	struct binder_thread *thread = NULL;
-	int wait_for_proc_work;
+	int wait_for_proc_work = 0;
 
 	mutex_lock(&binder_lock);
 	thread = binder_get_thread(proc);
 
-	wait_for_proc_work = thread->transaction_stack == NULL &&
-		list_empty(&thread->todo) && thread->return_error == BR_OK;
+	if (list_empty(&thread->todo) && thread->transaction_stack == NULL &&
+	    thread->return_error == BR_OK)
+		wait_for_proc_work = 1;
+
 	mutex_unlock(&binder_lock);
 
 	if (wait_for_proc_work) {
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2009-06-27  2:20 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 18:51 [PATCH 1/6] staging: android: binder: Remove some funny && usage Daniel Walker
2009-06-12 18:51 ` [PATCH 2/6] staging: android: binder: move debugging mask into a macro Daniel Walker
2009-06-12 18:51   ` [PATCH 3/6] staging: android: binder: remove a predefine Daniel Walker
2009-06-12 18:51     ` [PATCH 4/6] staging: android: binder: add enum usage in function arguments Daniel Walker
2009-06-12 18:51       ` [PATCH 5/6] staging: android: binder: global variable cleanup Daniel Walker
2009-06-12 18:51         ` [PATCH 6/6] staging: android: binder: clean up for all the stat statments Daniel Walker
2009-06-16 20:46 ` [PATCH 1/6] staging: android: binder: Remove some funny && usage Jeremy Fitzhardinge
2009-06-17 14:37   ` Daniel Walker
2009-06-17 15:28     ` Jeremy Fitzhardinge
2009-06-17 16:08       ` Daniel Walker
2009-06-17 16:31         ` Jeremy Fitzhardinge
2009-06-17 21:26           ` Arve Hjønnevåg
2009-06-17 21:31             ` Daniel Walker
2009-06-19 19:20               ` Brian Swetland
2009-06-19 22:53                 ` Daniel Walker
2009-06-20  0:13                   ` Arve Hjønnevåg
2009-06-20  0:49                     ` Daniel Walker
2009-06-20 18:48                       ` Christoph Hellwig
2009-06-21 12:09                       ` Marcel Holtmann
2009-06-25  4:09                       ` Dianne Hackborn
2009-06-25 10:14                         ` Marcel Holtmann
2009-06-25 11:34                           ` Alan Cox
2009-06-25 13:24                         ` Daniel Walker
2009-06-27  2:20                           ` GeunSik Lim
2009-06-20  1:26                     ` GeunSik Lim
2009-06-24 13:13                     ` Daniel Walker
2009-06-24 22:14                       ` Brian Swetland
2009-06-24 22:49                         ` Daniel Walker
2009-06-24 23:05                           ` Brian Swetland
2009-06-24 23:29                             ` Daniel Walker
2009-06-24 23:37                               ` Brian Swetland
2009-06-25  0:01                         ` Linus Walleij
2009-06-25  0:20                           ` Daniel Walker
2009-06-25  8:15                             ` Alan Cox
2009-06-25  9:56                               ` Marcel Holtmann
2009-06-17 21:38             ` Jeremy Fitzhardinge
2009-06-19 14:59   ` Pavel Machek
2009-06-19 15:08     ` Daniel Walker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.