From: Jagan Teki <jagannadh.teki@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] spi: mpc8xxx_spi: Use DIV_ROUND_UP instead of open-coded
Date: Wed, 07 Aug 2013 00:25:45 +0530 [thread overview]
Message-ID: <520146B1.1040902@gmail.com> (raw)
In-Reply-To: <52014552.30604@gmail.com>
On 07-08-2013 00:19, Jagan Teki wrote:
> On 12-07-2013 15:12, Axel Lin wrote:
>> Use DIV_ROUND_UP to simplify the code.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>> ---
>> drivers/spi/mpc8xxx_spi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
>> index 6b0e3b4..c90c0ce 100644
>> --- a/drivers/spi/mpc8xxx_spi.c
>> +++ b/drivers/spi/mpc8xxx_spi.c
>> @@ -93,7 +93,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;
>>
>>
>
> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
>
> --
> Thanks,
> Jagan.
Applied to u-boot-spi/master
--
Thanks,
Jagan.
next prev parent reply other threads:[~2013-08-06 18:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-12 9:39 [U-Boot] [PATCH 1/3] spi: bfin_spi: Use DIV_ROUND_UP instead of open-coded Axel Lin
2013-07-12 9:41 ` [U-Boot] [PATCH 2/3] spi: fsl_espi: " Axel Lin
2013-08-06 18:49 ` Jagan Teki
2013-08-06 18:56 ` Jagan Teki
2013-07-12 9:42 ` [U-Boot] [PATCH 3/3] spi: mpc8xxx_spi: " Axel Lin
2013-08-06 18:49 ` Jagan Teki
2013-08-06 18:55 ` Jagan Teki [this message]
2013-07-15 7:58 ` [U-Boot] [PATCH 1/3] spi: bfin_spi: " Sonic Zhang
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=520146B1.1040902@gmail.com \
--to=jagannadh.teki@gmail.com \
--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