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>master
parent
6c9b6c6351
commit
46ab507453
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue