All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Alex Dubov <oakad@yahoo.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] mmc: tifm_sd: Use min3() to simplify tifm_sd_transfer_data()
Date: Thu,  5 Mar 2026 13:25:49 +0100	[thread overview]
Message-ID: <20260305122553.249058-2-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260305122553.249058-1-thorsten.blum@linux.dev>

Use min3() to simplify tifm_sd_transfer_data().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/mmc/host/tifm_sd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index 2cd69c9e9571..c1f7d5b37911 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -193,9 +193,7 @@ static void tifm_sd_transfer_data(struct tifm_sd *host)
 
 		pg = sg_page(&sg[host->sg_pos]) + (off >> PAGE_SHIFT);
 		p_off = offset_in_page(off);
-		p_cnt = PAGE_SIZE - p_off;
-		p_cnt = min(p_cnt, cnt);
-		p_cnt = min(p_cnt, t_size);
+		p_cnt = min3(PAGE_SIZE - p_off, cnt, t_size);
 
 		if (r_data->flags & MMC_DATA_READ)
 			tifm_sd_read_fifo(host, pg, p_off, p_cnt);
-- 
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4


  reply	other threads:[~2026-03-05 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 12:25 [PATCH 1/2] mmc: sdio: Use min3() to simplify sdio_set_block_size() Thorsten Blum
2026-03-05 12:25 ` Thorsten Blum [this message]
2026-03-09 15:06   ` [PATCH 2/2] mmc: tifm_sd: Use min3() to simplify tifm_sd_transfer_data() Ulf Hansson
2026-03-09 15:06 ` [PATCH 1/2] mmc: sdio: Use min3() to simplify sdio_set_block_size() Ulf Hansson

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=20260305122553.249058-2-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=oakad@yahoo.com \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.