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.

vfio/pci: 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-33-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Yishai Hadas <yishaih@nvidia.com>
Cc: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand and committed by
Andrew Morton
fae6406b d66ff3db

+2 -4
+1 -2
drivers/vfio/pci/pds/lm.c
··· 151 151 lm_file->last_offset_sg = sg; 152 152 lm_file->sg_last_entry += i; 153 153 lm_file->last_offset = cur_offset; 154 - return nth_page(sg_page(sg), 155 - (offset - cur_offset) / PAGE_SIZE); 154 + return sg_page(sg) + (offset - cur_offset) / PAGE_SIZE; 156 155 } 157 156 cur_offset += sg->length; 158 157 }
+1 -2
drivers/vfio/pci/virtio/migrate.c
··· 53 53 buf->last_offset_sg = sg; 54 54 buf->sg_last_entry += i; 55 55 buf->last_offset = cur_offset; 56 - return nth_page(sg_page(sg), 57 - (offset - cur_offset) / PAGE_SIZE); 56 + return sg_page(sg) + (offset - cur_offset) / PAGE_SIZE; 58 57 } 59 58 cur_offset += sg->length; 60 59 }