lkml.org 
[lkml]   [2021]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] vfio/pci: Use vfio_device_unmap_mapping_range()
On Tue, Aug 10, 2021 at 10:53:50AM +0200, Christoph Hellwig wrote:
> On Thu, Aug 05, 2021 at 11:07:35AM -0600, Alex Williamson wrote:
> > +static void vfio_pci_zap_bars(struct vfio_pci_device *vdev)
> > {
> > + vfio_device_unmap_mapping_range(&vdev->vdev,
> > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_BAR0_REGION_INDEX),
> > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_ROM_REGION_INDEX) -
> > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_BAR0_REGION_INDEX));
>
> Maybe make this a little more readable by having local variables:

Or just pass in unmap_mapping_range(start=0, len=0)? As unmap_mapping_range()
understands len==0 as "to the end of file". Thanks,

--
Peter Xu

\
 
 \ /
  Last update: 2021-08-10 21:02    [W:0.129 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site