[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210726153853.151421379@linuxfoundation.org>
Date: Mon, 26 Jul 2021 17:40:05 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Yoshitaka Ikeda <ikeda@...int.co.jp>,
Mark Brown <broonie@...nel.org>
Subject: [PATCH 5.13 213/223] spi: spi-cadence-quadspi: Revert "Fix division by zero warning"
From: Yoshitaka Ikeda <ikeda@...int.co.jp>
commit 0ccfd1ba84a4503b509250941af149e9ebd605ca upstream.
Revert to change to a better code.
This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755.
Signed-off-by: Yoshitaka Ikeda <ikeda@...int.co.jp>
Link: https://lore.kernel.org/r/bd30bdb4-07c4-f713-5648-01c898d51f1b@nskint.co.jp
Signed-off-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/spi/spi-cadence-quadspi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -307,13 +307,11 @@ static unsigned int cqspi_calc_rdreg(str
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;
}
Powered by blists - more mailing lists