[U-Boot] [PATCH v4 21/24] spi: mxs_spi: Use GENMASK
Fabio Estevam
festevam at gmail.com
Thu Oct 22 23:18:36 CEST 2015
On Thu, Oct 22, 2015 at 7:15 PM, Jagan Teki <jteki at openedev.com> wrote:
>>> #define MXS_SPI_MAX_TIMEOUT 1000000
>>> #define MXS_SPI_PORT_OFFSET 0x2000
>>> -#define MXS_SSP_CHIPSELECT_MASK 0x00300000
>>> +#define MXS_SSP_CHIPSELECT_MASK GENMASK(21, 20)
>>
>> Does this really improve the code?
>
> GENMASK will simplificate the bit masking and most of drivers in Linux
> start using this along with BIT for bit shifting.
Most drivers?
In mainline kernel:
git grep GENMASK drivers/spi/ | wc -l
2
No, this is not most drivers ;-)
More information about the U-Boot
mailing list