lkml.org 
[lkml]   [2009]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/6] staging: android: binder: Remove some funny && usage
From
Date
On Tue, 2009-06-16 at 13:46 -0700, Jeremy Fitzhardinge wrote:
> >
> > 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;
> >
>
> I think the original looks cleaner (in both cases). Assigning a
> variable with the result of a boolean expression is perfectly
> reasonable. Perhaps change the type of the variable to "bool" to make
> it a bit clearer what's going on.

I agree it's reasonable in some cases.. The reason I changed this is
because at first glance I didn't know what those lines were suppose to
do. The equals signs all bleed together combined with the length of the
statement makes it not match other similar usage. The if statement just
makes the whole thing explicit.

Not to mention this code is a mess, very dense, and has little or no
comments. Anything that can be done to make the code more clear, seem
like a cleanup to me.

As for using "bool" , AFAIK that's only part of C++ ..

Daniel



\
 
 \ /
  Last update: 2009-06-17 16:41    [W:0.098 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site