OSDN Git Service

vfio/type1: Remove the almost unused check in vfio_iommu_type1_unpin_pages
authorShenming Lu <lushenming@huawei.com>
Tue, 6 Apr 2021 13:50:09 +0000 (21:50 +0800)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Apr 2021 17:53:50 +0000 (11:53 -0600)
commita536019d3e7d85a901c5e6a2f2894c0aa0acaefa
treee21b64a737f4bc78f4c1d9ecbc70297aded779b6
parentf5c858ec2b1d2a2656d78a5efe37cfcf568fce31
vfio/type1: Remove the almost unused check in vfio_iommu_type1_unpin_pages

The check i > npage at the end of vfio_iommu_type1_unpin_pages is unused
unless npage < 0, but if npage < 0, this function will return npage, which
should return -EINVAL instead. So let's just check the parameter npage at
the start of the function. By the way, replace unpin_exit with break.

Signed-off-by: Shenming Lu <lushenming@huawei.com>
Message-Id: <20210406135009.1707-1-lushenming@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c