Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763637AbZFLSv0 (ORCPT ); Fri, 12 Jun 2009 14:51:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754854AbZFLSvR (ORCPT ); Fri, 12 Jun 2009 14:51:17 -0400 Received: from fifo99.com ([67.223.236.141]:46209 "EHLO fifo99.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbZFLSvQ (ORCPT ); Fri, 12 Jun 2009 14:51:16 -0400 From: Daniel Walker To: Greg Kroah-Hartman Cc: Brian Swetland , linux-kernel@vger.kernel.org, Daniel Walker Subject: [PATCH 1/6] staging: android: binder: Remove some funny && usage Date: Fri, 12 Jun 2009 11:51:13 -0700 Message-Id: <1244832678-30329-1-git-send-email-dwalker@fifo99.com> X-Mailer: git-send-email 1.5.4.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1969 Lines: 59 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/