[U-Boot] [PATCH v4 21/24] spi: mxs_spi: Use GENMASK

Jagan Teki jteki at openedev.com
Fri Oct 23 10:23:29 CEST 2015


On 23 October 2015 at 02:48, Fabio Estevam <festevam at gmail.com> wrote:
> 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?

Most drivers will include all drivers in Linux not only spi drivers.

>
> In mainline kernel:
>
> git grep GENMASK drivers/spi/ | wc -l
> 2

# grep -R GENMASK drivers/ | wc -l
465

>
> No, this is not most drivers ;-)

-- 
Jagan | openedev.


More information about the U-Boot mailing list