| Message ID | 20260221094252.3103034-6-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
On 2/21/26 10:42, Dario Binacchi wrote: > Remove redundant divisions by using the already available xferlen > variable for setting the rx/tx buffer lengths. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > (no changes since v1) > > drivers/spi/stm32_spi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c > index a1f31cf653c7..adba97915cd3 100644 > --- a/drivers/spi/stm32_spi.c > +++ b/drivers/spi/stm32_spi.c > @@ -404,8 +404,8 @@ static int stm32_spi_xfer(struct udevice *slave, unsigned int bitlen, > > priv->tx_buf = dout; > priv->rx_buf = din; > - priv->tx_len = priv->tx_buf ? bitlen / 8 : 0; > - priv->rx_len = priv->rx_buf ? bitlen / 8 : 0; > + priv->tx_len = priv->tx_buf ? xferlen : 0; > + priv->rx_len = priv->rx_buf ? xferlen : 0; > > mode = SPI_FULL_DUPLEX; > if (!priv->tx_buf) Hi Dario Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Thanks Patrice To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c index a1f31cf653c7..adba97915cd3 100644 --- a/drivers/spi/stm32_spi.c +++ b/drivers/spi/stm32_spi.c @@ -404,8 +404,8 @@ static int stm32_spi_xfer(struct udevice *slave, unsigned int bitlen, priv->tx_buf = dout; priv->rx_buf = din; - priv->tx_len = priv->tx_buf ? bitlen / 8 : 0; - priv->rx_len = priv->rx_buf ? bitlen / 8 : 0; + priv->tx_len = priv->tx_buf ? xferlen : 0; + priv->rx_len = priv->rx_buf ? xferlen : 0; mode = SPI_FULL_DUPLEX; if (!priv->tx_buf)
Remove redundant divisions by using the already available xferlen variable for setting the rx/tx buffer lengths. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- (no changes since v1) drivers/spi/stm32_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)