linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: David Lechner <dlechner@baylibre.com>
Subject: [PATCH v1 2/2] spi: dw: Use spi_bpw_to_bytes() helper
Date: Wed, 16 Apr 2025 09:16:35 +0300	[thread overview]
Message-ID: <20250416062013.1826421-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250416062013.1826421-1-andriy.shevchenko@linux.intel.com>

Use existing helper to get amount of bytes (as power-of-two value)
from bits per word.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-dw-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
index 941ecc6f59f8..b3b883cb9541 100644
--- a/drivers/spi/spi-dw-core.c
+++ b/drivers/spi/spi-dw-core.c
@@ -423,7 +423,7 @@ static int dw_spi_transfer_one(struct spi_controller *host,
 	int ret;
 
 	dws->dma_mapped = 0;
-	dws->n_bytes = roundup_pow_of_two(BITS_TO_BYTES(transfer->bits_per_word));
+	dws->n_bytes = spi_bpw_to_bytes(transfer->bits_per_word);
 	dws->tx = (void *)transfer->tx_buf;
 	dws->tx_len = transfer->len / dws->n_bytes;
 	dws->rx = transfer->rx_buf;
-- 
2.47.2


  parent reply	other threads:[~2025-04-16  6:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  6:16 [PATCH v1 0/2] spi: Introduce and use spi_bpw_to_bytes() Andy Shevchenko
2025-04-16  6:16 ` [PATCH v1 1/2] spi: Add spi_bpw_to_bytes() helper and use it Andy Shevchenko
2025-04-16  7:03   ` Mukesh Kumar Savaliya
2025-04-16  7:09     ` Andy Shevchenko
2025-04-16  7:34       ` Mukesh Kumar Savaliya
2025-04-16 14:56   ` David Lechner
2025-04-16 15:14     ` Andy Shevchenko
2025-04-16  6:16 ` Andy Shevchenko [this message]
2025-04-18  5:25 ` [PATCH v1 0/2] spi: Introduce and use spi_bpw_to_bytes() Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250416062013.1826421-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).