public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings
@ 2015-06-14 17:33 Chakra Divi
  2015-06-14 17:33 ` [U-Boot] [PATCH] This patch clears the errors found my running checkpatch.pl on file drivers/spi/fsl_espi.c Chakra Divi
  2015-06-16 11:00 ` [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Jagan Teki
  0 siblings, 2 replies; 3+ messages in thread
From: Chakra Divi @ 2015-06-14 17:33 UTC (permalink / raw)
  To: u-boot

This patch clears the errors found by running checkpatch.pl on file drivers/spi/fsl_espi.c

Signed-off-by: Chakra Divi <cdivi@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));
 		}
-	} 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 */
 }
 
 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 */
 }
 
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] This patch clears the errors found my running checkpatch.pl on file drivers/spi/fsl_espi.c
  2015-06-14 17:33 [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Chakra Divi
@ 2015-06-14 17:33 ` Chakra Divi
  2015-06-16 11:00 ` [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Jagan Teki
  1 sibling, 0 replies; 3+ messages in thread
From: Chakra Divi @ 2015-06-14 17:33 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Chakra Divi <cdivi@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));
 		}
-	} 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 */
 }
 
 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 */
 }
 
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings
  2015-06-14 17:33 [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Chakra Divi
  2015-06-14 17:33 ` [U-Boot] [PATCH] This patch clears the errors found my running checkpatch.pl on file drivers/spi/fsl_espi.c Chakra Divi
@ 2015-06-16 11:00 ` Jagan Teki
  1 sibling, 0 replies; 3+ messages in thread
From: Jagan Teki @ 2015-06-16 11:00 UTC (permalink / raw)
  To: u-boot

On 14 June 2015 at 23:03, Chakra Divi <cdivi@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@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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-16 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-14 17:33 [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Chakra Divi
2015-06-14 17:33 ` [U-Boot] [PATCH] This patch clears the errors found my running checkpatch.pl on file drivers/spi/fsl_espi.c Chakra Divi
2015-06-16 11:00 ` [U-Boot] [PATCH] spi: fsl_espi.c: fix checkpatch.pl erorrs/warnings Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox