[U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings

Jagan Teki jteki at openedev.com
Tue Jun 16 13:00:29 CEST 2015


On 14 June 2015 at 23:03, Chakra Divi <cdivi at openedev.com> wrote:
> This patch clears the errors found by running checkpatch.pl on file drivers/spi/fsl_espi.c
>
> Signed-off-by: Chakra Divi <cdivi at openedev.com>
> ---
>  drivers/spi/fsl_espi.c |   14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index 375dc07..9d9a6e0 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -92,11 +92,12 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
>                 pm = spibrg / (max_hz * 16 * 2);
>                 if (pm > 16) {
>                         pm = 16;
> -                       debug("Requested speed is too low: %d Hz, %ld Hz "
> -                               "is used.\n", max_hz, spibrg / (32 * 16));
> +                       debug("Requested speed is too low: %d Hz, %ld Hz
> +                               is used.\n", max_hz, spibrg / (32 * 16));

This is wrong, fires compilation error - check it

>                 }
> -       } else
> +       } else {
>                 pm = spibrg / (max_hz * 2);
> +       }
>         if (pm)
>                 pm--;
>         fsl->pm = pm;
> @@ -121,7 +122,7 @@ void spi_free_slave(struct spi_slave *slave)
>
>  void spi_init(void)
>  {
> -
> +       ; /* Do nothing */

Adding comment is enough - ; may not require.

>  }
>
>  int spi_claim_bus(struct spi_slave *slave)
> @@ -177,7 +178,7 @@ int spi_claim_bus(struct spi_slave *slave)
>
>  void spi_release_bus(struct spi_slave *slave)
>  {
> -
> +       ; /* Do nothing */

ditto.

>  }
>
>  static void fsl_espi_tx(struct fsl_spi_slave *fsl, const void *dout)
> @@ -264,7 +265,8 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
>         max_tran_len = fsl->max_transfer_length;
>         switch (flags) {
>         case SPI_XFER_BEGIN:
> -               cmd_len = fsl->cmd_len = data_len;
> +               fsl->cmd_len = data_len;
> +               cmd_len = fsl->cmd_len;
>                 memcpy(cmd_buf, data_out, cmd_len);
>                 return 0;
>         case 0:
> --
> 1.7.9.5
>

thanks!
-- 
Jagan | openedev.


More information about the U-Boot mailing list