[U-Boot] [PATCH] spi: Use DIV_ROUND_UP at appropriate places

Jagan Teki jagannadh.teki at gmail.com
Fri Jun 14 14:20:19 CEST 2013


Hi,

IMHO:
Can you please use the proper commit header prefix.

I am just sharing my thoughts, ignore this if you know it already.
I followed below syntax.
"<main_module>:  <sub_module>:  <sub_sub_module>:  <COMMIT_HEADER>"

Ex: for this commit (seems like this commit changes two drivers)
spi: cf_qspi | mxc_spi: Use DIV_ROUND_UP at appropriate places

if you send same changes individually.
spi: cf_qspi: Use DIV_ROUND_UP at appropriate places
spi: mxc_spi: Use DIV_ROUND_UP at appropriate places

On Fri, Jun 14, 2013 at 1:29 PM, Axel Lin <axel.lin at ingics.com> wrote:
> This change slightly improves readability.
>
> Signed-off-by: Axel Lin <axel.lin at ingics.com>
> ---
>  drivers/spi/cf_qspi.c | 2 +-
>  drivers/spi/mxc_spi.c | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c
> index a37ac4e..06bcf91 100644
> --- a/drivers/spi/cf_qspi.c
> +++ b/drivers/spi/cf_qspi.c
> @@ -171,7 +171,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
>         volatile qspi_t *qspi = dev->regs;
>         u8 *txbuf = (u8 *)dout;
>         u8 *rxbuf = (u8 *)din;
> -       u32 count = ((bitlen / 8) + (bitlen % 8 ? 1 : 0));

Was this equivalent to  (bitlen + 7) / 8 ?

--
Thanks,
Jagan.


More information about the U-Boot mailing list