From: Tom Rini Date: Thu, 22 Oct 2015 17:24:23 -0400 Subject: [U-Boot] [PATCH v4 08/24] spi: exynos_spi: Use BIT macro In-Reply-To: <1445547024-7774-9-git-send-email-jteki@openedev.com> References: <1445547024-7774-1-git-send-email-jteki@openedev.com> <1445547024-7774-9-git-send-email-jteki@openedev.com> Message-ID: <20151022212423.GZ23893@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 Fri, Oct 23, 2015 at 02:20:08AM +0530, Jagan Teki wrote: > Replace numerical bit shift with BIT macro in exynos_spi > > :%s/(1 << nr)/BIT(nr)/g > where nr = 0, 1, 2 .... 31 > > Cc: Simon Glass > Signed-off-by: Jagan Teki > --- > drivers/spi/exynos_spi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c > index 44948c3..ea3c51d 100644 > --- a/drivers/spi/exynos_spi.c > +++ b/drivers/spi/exynos_spi.c > @@ -86,7 +86,7 @@ static void spi_request_bytes(struct exynos_spi *regs, int count, int step) > writel(0, ®s->swap_cfg); > } > > - assert(count && count < (1 << 16)); > + assert(count && count < BIT(16)); > setbits_le32(®s->ch_cfg, SPI_CH_RST); > clrbits_le32(®s->ch_cfg, SPI_CH_RST); > > @@ -345,7 +345,7 @@ static int exynos_spi_xfer(struct udevice *dev, unsigned int bitlen, > */ > bytelen = bitlen / 8; > for (upto = 0; !ret && upto < bytelen; upto += todo) { > - todo = min(bytelen - upto, (1 << 16) - 4); > + todo = min(bytelen - upto, BIT(16) - 4); > ret = spi_rx_tx(priv, todo, &din, &dout, flags); > if (ret) > break; These look like (1 << 16) is a size, not a bit. Can you read the functions in context and confirm that it really is bit 16 here, rather than 4KiB (0x10000) ? > -- > 1.9.1 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: