On Mon, May 05, 2025 at 01:28:02PM +0200, Cédric Le Goater wrote:

> > +static int vfio_legacy_dma_unmap(const VFIOContainerBase *bcontainer,
> > +                                 hwaddr iova, ram_addr_t size,
> > +                                 IOMMUTLBEntry *iotlb, bool unmap_all)
> > +{
> > +    int ret;
> > +
> > +    if (unmap_all) {
> > +        /* The unmap ioctl doesn't accept a full 64-bit span. */
> > +        Int128 llsize = int128_rshift(int128_2_64(), 1);
> > +
> > +        ret = vfio_legacy_dma_unmap_one(bcontainer, 0, 
> > int128_get64(llsize),
> > +                                        iotlb);
> > +
> > +        if (ret == 0) {
> > +            ret = vfio_legacy_dma_unmap_one(bcontainer, 
> > int128_get64(llsize),
> > +                                            int128_get64(llsize), iotlb);
> > +        }
> > +
> > +    } else {
> > +        ret = vfio_legacy_dma_unmap_one(bcontainer, iova, size, iotlb);
> > +    }
> > +
> > +    if (ret != 0) {
> > +        return -errno;
> > +    }
> 
> the ret value should already be an errno. Shouldn't it ?

Yes, this can just be "return ret", thanks.

regards
john

Reply via email to