Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ata: libata-sff: drop nth_page() usage within SG entry

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>

authored by

David Hildenbrand and committed by
Andrew Morton
70aa9026 80e7bb74

+3 -3
+3 -3
drivers/ata/libata-sff.c
··· 614 614 offset = qc->cursg->offset + qc->cursg_ofs; 615 615 616 616 /* get the current page and offset */ 617 - page = nth_page(page, (offset >> PAGE_SHIFT)); 617 + page += offset >> PAGE_SHIFT; 618 618 offset %= PAGE_SIZE; 619 619 620 620 /* don't overrun current sg */ ··· 631 631 unsigned int split_len = PAGE_SIZE - offset; 632 632 633 633 ata_pio_xfer(qc, page, offset, split_len); 634 - ata_pio_xfer(qc, nth_page(page, 1), 0, count - split_len); 634 + ata_pio_xfer(qc, page + 1, 0, count - split_len); 635 635 } else { 636 636 ata_pio_xfer(qc, page, offset, count); 637 637 } ··· 751 751 offset = sg->offset + qc->cursg_ofs; 752 752 753 753 /* get the current page and offset */ 754 - page = nth_page(page, (offset >> PAGE_SHIFT)); 754 + page += offset >> PAGE_SHIFT; 755 755 offset %= PAGE_SIZE; 756 756 757 757 /* don't overrun current sg */