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

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


On 23 October 2015 at 03:00, Marek Vasut <marex at denx.de> wrote:
> On Thursday, October 22, 2015 at 11:15:26 PM, Jagan Teki wrote:
>> On 23 October 2015 at 02:38, Fabio Estevam <festevam at gmail.com> wrote:
>> > On Thu, Oct 22, 2015 at 6:50 PM, Jagan Teki <jteki at openedev.com> wrote:
>> >> Replace numeric mask hexcodes with GENMASK macro in mxs_spi
>> >>
>> >> Cc: Marek Vasut <marex at denx.de>
>> >> Signed-off-by: Jagan Teki <jteki at openedev.com>
>> >> ---
>> >>
>> >>  drivers/spi/mxs_spi.c | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
>> >> index 627644b..459c603 100644
>> >> --- a/drivers/spi/mxs_spi.c
>> >> +++ b/drivers/spi/mxs_spi.c
>> >> @@ -23,7 +23,7 @@
>> >>
>> >>  #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
>
> You mean [1] ? :-) In that case, I agree ...
> "
> simplificate

I just used simplificate as per the sentence formation which I would
it's reasonable. Look like simplificate similar to simplify [1]

[1] http://www.dictionarist.com/english-english/simplificate

>
> verb - the action of taking an answered that is simplified and extending the
> answer to the point of complete and utter obscurity, unreadable by anyone, yet
> still correct.
>
> See also: BS
> "
>
> [1] http://cs.urbandictionary.com/define.php?term=simplificate&defid=2897356
>
>> the bit masking and most of drivers in Linux
>> start using this along with BIT for bit shifting.
>>
>> > Personally I prefer the original code as I don't need to go and look
>> > at the definition of the GENMASK() macro.

-- 
Jagan | openedev.


More information about the U-Boot mailing list