[U-Boot] spi: cf_spi: Question about checking (dspi->sr & 0x0000F000) witch magic number 4

Axel Lin axel.lin at ingics.com
Fri Jun 14 18:55:25 CEST 2013


Hi,
While reading the code in cfspi_tx():
        while ((dspi->sr & 0x0000F000) >= 4) ;

I don't see the point of checking "(dspi->sr & 0x0000F000) >= 4)".

I'm wondering if it should be
        while ((dspi->sr & 0x0000F000) >> 12) >= 4) ;
or simply
        while (dspi->sr & 0x0000F000) ;

Current code actually has the same effect as "while (dspi->sr & 0x0000F000) ;".

comments?

Axel




More information about the U-Boot mailing list