]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ata: libata-sff: drop nth_page() usage within SG entry
authorDavid Hildenbrand <david@redhat.com>
Mon, 1 Sep 2025 15:03:46 +0000 (17:03 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:25:35 +0000 (17:25 -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-26-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/ata/libata-sff.c

index 7fc407255eb4695a7964b1de39a5f3ae8a737c63..1e2a2c33cdc8026bc22bc486c3ed372e9cc6f10f 100644 (file)
@@ -614,7 +614,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
        offset = qc->cursg->offset + qc->cursg_ofs;
 
        /* get the current page and offset */
-       page = nth_page(page, (offset >> PAGE_SHIFT));
+       page += offset >> PAGE_SHIFT;
        offset %= PAGE_SIZE;
 
        /* don't overrun current sg */
@@ -631,7 +631,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
                unsigned int split_len = PAGE_SIZE - offset;
 
                ata_pio_xfer(qc, page, offset, split_len);
-               ata_pio_xfer(qc, nth_page(page, 1), 0, count - split_len);
+               ata_pio_xfer(qc, page + 1, 0, count - split_len);
        } else {
                ata_pio_xfer(qc, page, offset, count);
        }
@@ -751,7 +751,7 @@ next_sg:
        offset = sg->offset + qc->cursg_ofs;
 
        /* get the current page and offset */
-       page = nth_page(page, (offset >> PAGE_SHIFT));
+       page += offset >> PAGE_SHIFT;
        offset %= PAGE_SIZE;
 
        /* don't overrun current sg */