projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a444aa7
)
spi: mpc8xxx_spi: Use DIV_ROUND_UP instead of open-coded
author
Axel Lin
<axel.lin@ingics.com>
Fri, 12 Jul 2013 09:42:15 +0000
(17:42 +0800)
committer
Jagannadha Sutradharudu Teki
<jaganna@xilinx.com>
Tue, 6 Aug 2013 18:28:24 +0000
(23:58 +0530)
Use DIV_ROUND_UP to simplify the code.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
drivers/spi/mpc8xxx_spi.c
patch
|
blob
|
history
diff --git
a/drivers/spi/mpc8xxx_spi.c
b/drivers/spi/mpc8xxx_spi.c
index bbfc259e47382e8c690289bcb445deb0beaf6977..348361a7fd078d1cbcc5f1a0f926faa2a7173c03 100644
(file)
--- a/
drivers/spi/mpc8xxx_spi.c
+++ b/
drivers/spi/mpc8xxx_spi.c
@@
-77,7
+77,7
@@
int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
{
volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi;
unsigned int tmpdout, tmpdin, event;
- int numBlks =
bitlen / 32 + (bitlen % 32 ? 1 : 0
);
+ int numBlks =
DIV_ROUND_UP(bitlen, 32
);
int tm, isRead = 0;
unsigned char charSize = 32;