diff mbox series

[v4,1/2] spi: spi-cadence-quadspi: Revert "Fix division by zero warning"

Message ID 760be709-74d1-14cc-fecf-433786e123aa@nskint.co.jp (mailing list archive)
State Superseded
Headers show
Series spi: spi-cadence-quadspi: Fix division by zero warning | expand

Commit Message

Yoshitaka Ikeda July 16, 2021, 3:07 a.m. UTC
Revert to change to a better code.

This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755.
---
 drivers/spi/spi-cadence-quadspi.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Pratyush Yadav July 16, 2021, 7:27 a.m. UTC | #1
On 16/07/21 03:07AM, Yoshitaka Ikeda wrote:
> Revert to change to a better code.
> 
> This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755.

I don't think this is needed since your earlier version was not applied 
to the SPI tree in the first place. Patch 2 alone should be enough.

> ---
>  drivers/spi/spi-cadence-quadspi.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
> index 13d1f0ce618e..7a00346ff9b9 100644
> --- a/drivers/spi/spi-cadence-quadspi.c
> +++ b/drivers/spi/spi-cadence-quadspi.c
> @@ -307,13 +307,11 @@ static unsigned int cqspi_calc_rdreg(struct cqspi_flash_pdata *f_pdata)
>  
>  static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr)
>  {
> -	unsigned int dummy_clk = 0;
> +	unsigned int dummy_clk;
>  
> -	if (op->dummy.buswidth && op->dummy.nbytes) {
> -		dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
> -		if (dtr)
> -			dummy_clk /= 2;
> -	}
> +	dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
> +	if (dtr)
> +		dummy_clk /= 2;
>  
>  	return dummy_clk;
>  }
> -- 
> 2.32.0
Mark Brown July 16, 2021, 12:23 p.m. UTC | #2
On Fri, Jul 16, 2021 at 03:07:21AM +0000, Yoshitaka Ikeda wrote:
> Revert to change to a better code.
> 
> This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755.
> ---
>  drivers/spi/spi-cadence-quadspi.c | 10 ++++------

You've not provided a Signed-off-by for this so I can't do anything with
it, please see Documentation/process/submitting-patches.rst for details
on what this is and why it's important.
Yoshitaka Ikeda July 16, 2021, 2:26 p.m. UTC | #3
On 2021/07/16 21:23, Mark Brown wrote:
> You've not provided a Signed-off-by for this so I can't do anything with
> it, please see Documentation/process/submitting-patches.rst for details
> on what this is and why it's important.

I'm sorry, I was wrong.
I will resubmit the patch separately.
diff mbox series

Patch

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 13d1f0ce618e..7a00346ff9b9 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -307,13 +307,11 @@  static unsigned int cqspi_calc_rdreg(struct cqspi_flash_pdata *f_pdata)
 
 static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr)
 {
-	unsigned int dummy_clk = 0;
+	unsigned int dummy_clk;
 
-	if (op->dummy.buswidth && op->dummy.nbytes) {
-		dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
-		if (dtr)
-			dummy_clk /= 2;
-	}
+	dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
+	if (dtr)
+		dummy_clk /= 2;
 
 	return dummy_clk;
 }