mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] mci: stm32_sdmmc2: fix benign typo in dma_map_single
Date: Thu, 10 Apr 2025 15:03:02 +0200	[thread overview]
Message-ID: <20250410130301.116356-1-a.fatoum@pengutronix.de> (raw)

struct mci_data::src and ::dest are members of the same union and thus
can be used interchangeably, provided that the difference in type is
accounted for.

Nevertheless, it makes code easier to reason about and saves needless
casts to use the correct union member. Do that for the read case.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/stm32_sdmmc2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index 64a7171d2cae..30745ea7c6c0 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -271,7 +271,7 @@ static dma_addr_t stm32_sdmmc2_start_data(struct stm32_sdmmc2_priv *priv,
 
 	if (data->flags & MMC_DATA_READ) {
 		data_ctrl |= SDMMC_DCTRL_DTDIR;
-		idmabase0 = dma_map_single(priv->dev, (void *)data->src, num_bytes,
+		idmabase0 = dma_map_single(priv->dev, data->dest, num_bytes,
 					   DMA_FROM_DEVICE);
 	} else {
 		idmabase0 = dma_map_single(priv->dev, (void *)data->src, num_bytes,
-- 
2.39.5




             reply	other threads:[~2025-04-10 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 13:03 Ahmad Fatoum [this message]
2025-04-11  7:14 ` Sascha Hauer

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=20250410130301.116356-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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