Re: [PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-26 Thread Timur Tabi
Arnd Bergmann wrote: > On Tuesday 26 May 2009, Geert Uytterhoeven wrote: >> However, you can still improve useability by making the macro return the rc, >> instead of letting the caller pass it, cfr. wait_event_timeout() and friends. I had that originally, but somewhere during the seven revisions

Re: [PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-26 Thread Arnd Bergmann
On Tuesday 26 May 2009, Geert Uytterhoeven wrote: > However, you can still improve useability by making the macro return the rc, > instead of letting the caller pass it, cfr. wait_event_timeout() and friends. Either that, or it should at least use the do { ... } while (0) construct to make the mac

Re: [PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-26 Thread Geert Uytterhoeven
On Tue, 26 May 2009, Timur Tabi wrote: > On Tue, May 26, 2009 at 2:29 AM, Geert Uytterhoeven > wrote: > > > static inline function, returning rc, instead of a macro? > > It won't work as an inline function ... > > >> +     unsigned long __loops = tb_ticks_per_usec * timeout;                \ >

Re: [PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-26 Thread Timur Tabi
On Tue, May 26, 2009 at 2:29 AM, Geert Uytterhoeven wrote: > static inline function, returning rc, instead of a macro? It won't work as an inline function ... >> +     unsigned long __loops = tb_ticks_per_usec * timeout;                \ >> +     unsigned long __start = get_tbl();              

Re: [PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-26 Thread Geert Uytterhoeven
On Mon, 25 May 2009, Jon Smirl wrote: > (in microseconds) as parameters. It spins until either the condition is true > or the timeout expires. It returns the result of the condition when the loop > was terminated. > > This primary purpose of this macro is to poll on a hardware register until a >

[PATCH V4 1/5] The macro spin_event_timeout() takes a condition and timeout value

2009-05-25 Thread Jon Smirl
(in microseconds) as parameters. It spins until either the condition is true or the timeout expires. It returns the result of the condition when the loop was terminated. This primary purpose of this macro is to poll on a hardware register until a status bit changes. The timeout ensures that the