]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfio/type1: Use consistent types for page counts
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 18 Feb 2025 22:22:04 +0000 (15:22 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 27 Feb 2025 18:55:54 +0000 (11:55 -0700)
commit0635559233434a337aa1c20d53abae18b3663796
tree7feb6a9c5f24d642ba5a8d0b2cd0ef720c8bf6bc
parenteb996eec783c1e7e1e9c62e0336f8b86a08cf541
vfio/type1: Use consistent types for page counts

Page count should more consistently be an unsigned long when passed as
an argument while functions returning a number of pages should use a
signed long to allow for -errno.

vaddr_get_pfns() can therefore be upgraded to return long, though in
practice it's currently limited by the batch capacity.  In fact, the
batch indexes are noted to never hold negative values, so while it
doesn't make sense to bloat the structure with unsigned longs in this
case, it does make sense to specify these as unsigned.

No change in behavior expected.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Tested-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20250218222209.1382449-5-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c