mmc: tifm_sd: Use min3() to simplify tifm_sd_transfer_data()

Use min3() to simplify tifm_sd_transfer_data().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Thorsten Blum 2026-03-05 13:25:49 +01:00 committed by Ulf Hansson
parent 6c9b6c6351
commit 46ab507453

View File

@ -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);