]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: drop nth_page() usage within SG entry
authorDavid Hildenbrand <david@redhat.com>
Mon, 1 Sep 2025 15:03:50 +0000 (17:03 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Sep 2025 21:22:08 +0000 (14:22 -0700)
It's no longer required to use nth_page() when iterating pages within a
single SG entry, so let's drop the nth_page() usage.

Link: https://lkml.kernel.org/r/20250901150359.867252-30-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/mmc/host/tifm_sd.c
drivers/mmc/host/usdhi6rol0.c

index ac636efd911d37ce54ace8a3b5df2657cedb653d..2cd69c9e9571bba1d9f3145430d58f56cbf1f000 100644 (file)
@@ -191,7 +191,7 @@ static void tifm_sd_transfer_data(struct tifm_sd *host)
                }
                off = sg[host->sg_pos].offset + host->block_pos;
 
-               pg = nth_page(sg_page(&sg[host->sg_pos]), off >> PAGE_SHIFT);
+               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);
@@ -240,7 +240,7 @@ static void tifm_sd_bounce_block(struct tifm_sd *host, struct mmc_data *r_data)
                }
                off = sg[host->sg_pos].offset + host->block_pos;
 
-               pg = nth_page(sg_page(&sg[host->sg_pos]), off >> PAGE_SHIFT);
+               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);
index 85b49c07918b36abb95a6544bcab8abcdc553c81..3bccf800339ba2f68908a2fd52bff9b569687ab0 100644 (file)
@@ -323,7 +323,7 @@ static void usdhi6_blk_bounce(struct usdhi6_host *host,
 
        host->head_pg.page      = host->pg.page;
        host->head_pg.mapped    = host->pg.mapped;
-       host->pg.page           = nth_page(host->pg.page, 1);
+       host->pg.page           = host->pg.page + 1;
        host->pg.mapped         = kmap(host->pg.page);
 
        host->blk_page = host->bounce_buf;
@@ -503,7 +503,7 @@ static void usdhi6_sg_advance(struct usdhi6_host *host)
        /* We cannot get here after crossing a page border */
 
        /* Next page in the same SG */
-       host->pg.page = nth_page(sg_page(host->sg), host->page_idx);
+       host->pg.page = sg_page(host->sg) + host->page_idx;
        host->pg.mapped = kmap(host->pg.page);
        host->blk_page = host->pg.mapped;