From: Tom Rini Date: Thu, 22 Oct 2015 17:25:18 -0400 Subject: [U-Boot] [PATCH v4 21/24] spi: mxs_spi: Use GENMASK In-Reply-To: References: <1445547024-7774-1-git-send-email-jteki@openedev.com> <1445547024-7774-22-git-send-email-jteki@openedev.com> Message-ID: <20151022212518.GL23893@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Oct 22, 2015 at 07:08:32PM -0200, Fabio Estevam wrote: > On Thu, Oct 22, 2015 at 6:50 PM, Jagan Teki wrote: > > Replace numeric mask hexcodes with GENMASK macro in mxs_spi > > > > Cc: Marek Vasut > > Signed-off-by: Jagan Teki > > --- > > 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? > > Personally I prefer the original code as I don't need to go and look > at the definition of the GENMASK() macro. Fair point. This is a kernel helper macro but it's "new" and still gaining traction. I personally do find GENMASK(hi, lo) and BIT(x) more readable. Others don't. That's fine. The question I have here is, who is spending the most time in these drivers? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: