On Wed, 2 Sep 2009 08:47:18 -0700 David Brownell <[email protected]> wrote:

> On Tuesday 01 September 2009, Andrew Morton wrote:
> > > +#define 
> > > busy_wait(cond)____________________________________________________________________________________________________________\
> > > +__________({____________________________________________________________________________________________________________________________\
> > > +__________unsigned long end_jiffies = jiffies + 
> > > STMP_SPI_TIMEOUT;__________________\
> > > +__________bool succeeded = 
> > > false;__________________________________________________________________________________\
> > > +__________do 
> > > {________________________________________________________________________________________________________________________\
> > > +__________________________if (cond) 
> > > {__________________________________________________________________________________________\
> > > +__________________________________________succeeded = 
> > > true;______________________________________________________________\
> > > +__________________________________________break;____________________________________________________________________________________\
> > > +__________________________}______________________________________________________________________________________________________________\
> > > +__________________________cpu_relax();________________________________________________________________________________________\
> > > +__________} while (time_before(end_jiffies, 
> > > jiffies));________________________________________\
> > > +__________succeeded;____________________________________________________________________________________________________________\
> > > +__________})

(^^ your email client turns 0x09's into 0xa0's)


> > Oh dear.
> 
> Bothered me a bit too, but ... compared to <linux/wait.h> and
> all the wait_event_*() macros, I couldn't object much.  :)

The use of a macro is a minor issue.

The "oh dear" issue is that this driver does so much busy-waiting.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to