lkml.org 
[lkml]   [2011]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4 3/4] ARM: Xilinx: base header files and assembly macros
On Mon, Feb 28, 2011 at 07:20:32AM -0700, John Linn wrote:
[...]
> > > +
> > > +static inline void flush(void)
> > > +{
> > > + u32 status;
> > > + /*
> > > + * Wait while the FIFO is not empty
> > > + */
> > > + while (1) {
> > > + status = __raw_readl(IOMEM(LL_UART_PADDR +
> UART_SR_OFFSET));
> > > + if (status & UART_SR_TXEMPTY)
> > > + break;
> > > + cpu_relax();
> > > + }
> >
> > This could be written as:
> >
> > static inline void flush(void)
> > {
> > while (!(__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) &
> > UART_SR_TXEMPTY))
> > cpu_relax();
> > }
>
> Honestly I had it that way as I know most in the community do that and
> terse-ness is somewhat preferred.
>
> I thought my way is a bit clearer as it was a bit harder to read the
> other way.
>
> Do you think everyone else would say to change it? No big deal to
> change it.

I guess it's largely down to personal preference. Personally I find the
infinite loop with conditional break harder to read but then I'm not
going to the the primary maintainer ;-)

Jamie


\
 
 \ /
  Last update: 2011-02-28 16:05    [W:0.059 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site