public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 21/24] spi: mxs_spi: Use GENMASK
Date: Thu, 22 Oct 2015 23:30:10 +0200	[thread overview]
Message-ID: <201510222330.10783.marex@denx.de> (raw)
In-Reply-To: <CAD6G_RQHte7uA__9cxM3Ckxm58XPcCbOY95Syze_2oy8OE8tAw@mail.gmail.com>

On Thursday, October 22, 2015 at 11:15:26 PM, Jagan Teki wrote:
> On 23 October 2015 at 02:38, Fabio Estevam <festevam@gmail.com> wrote:
> > On Thu, Oct 22, 2015 at 6:50 PM, Jagan Teki <jteki@openedev.com> wrote:
> >> Replace numeric mask hexcodes with GENMASK macro in mxs_spi
> >> 
> >> Cc: Marek Vasut <marex@denx.de>
> >> Signed-off-by: Jagan Teki <jteki@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

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.

Best regards,
Marek Vasut

  parent reply	other threads:[~2015-10-22 21:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 20:50 [U-Boot] [PATCH v4 00/24] spi: Use BIT and GENMASK Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 01/24] spi: zynq_[q]spi: Use BIT macro Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 02/24] spi: zynq_[q]spi: Use GENMASK macro Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 03/24] spi: altera_spi: Use BIT macro Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 04/24] spi: atmel_spi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 05/24] spi: bfin_spi6xx: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 06/24] spi: cadence_qspi_apb: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-23 17:11   ` Vikas MANOCHA
2015-10-22 20:50 ` [U-Boot] [PATCH v4 07/24] spi: designware_spi: " Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 08/24] spi: exynos_spi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-24  3:26     ` Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 09/24] spi: fsl: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 10/24] spi: ich: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 11/24] spi: mpc8xxx_spi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 12/24] spi: omap3_spi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 13/24] spi: sh_qspi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 14/24] spi: tegra: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 15/24] spi: ti_qspi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 16/24] spi: xilinx_spi: " Jagan Teki
2015-10-22 21:24   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 17/24] spi: atmel_spi: Use GENMASK Jagan Teki
2015-10-22 21:25   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 18/24] spi: cadence_qspi_apb: " Jagan Teki
2015-10-22 21:10   ` Fabio Estevam
2015-10-22 21:25     ` Tom Rini
2015-10-23 17:17       ` Jagan Teki
2015-10-23 18:17         ` Marek Vasut
2015-10-23 18:39         ` Fabio Estevam
2015-10-23 20:03         ` Tom Rini
2015-10-23 17:11   ` Vikas MANOCHA
2015-10-23 18:18   ` Marek Vasut
2015-10-22 20:50 ` [U-Boot] [PATCH v4 19/24] spi: designware_spi: " Jagan Teki
2015-10-22 21:25   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 20/24] spi: fsl_qspi: " Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 21/24] spi: mxs_spi: " Jagan Teki
2015-10-22 21:08   ` Fabio Estevam
2015-10-22 21:15     ` Jagan Teki
2015-10-22 21:18       ` Fabio Estevam
2015-10-23  8:23         ` Jagan Teki
2015-10-22 21:30       ` Marek Vasut [this message]
2015-10-23  8:27         ` Jagan Teki
2015-10-22 21:25     ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 22/24] spi: omap3_spi: " Jagan Teki
2015-10-22 21:25   ` Tom Rini
2015-10-22 20:50 ` [U-Boot] [PATCH v4 23/24] spi: tegra: " Jagan Teki
2015-10-22 20:50 ` [U-Boot] [PATCH v4 24/24] spi: xilinx_spi: " Jagan Teki
2015-10-22 21:25 ` [U-Boot] [PATCH v4 00/24] spi: Use BIT and GENMASK Tom Rini
2015-10-23 17:10   ` Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201510222330.10783.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox