]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vfio/pci: Fix sparse warning in vfio_pci_core_get_iomap()
authorMatt Evans <mattev@meta.com>
Fri, 22 May 2026 12:42:11 +0000 (05:42 -0700)
committerAlex Williamson <alex@shazbot.org>
Fri, 22 May 2026 14:36:11 +0000 (08:36 -0600)
Use IOMEM_ERR_PTR() when returning a void __iomem * rather than
ERR_PTR().  This fixes a sparse warning, "different address spaces".

Fixes: 859dc0f6253b ("vfio/pci: Replace vfio_pci_core_setup_barmap() with vfio_pci_core_get_iomap()")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605211601.U1OvmuqY-lkp@intel.com/
Signed-off-by: Matt Evans <mattev@meta.com>
Link: https://lore.kernel.org/r/20260522124215.3268565-1-mattev@meta.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
include/linux/vfio_pci_core.h

index 7accd0eac457d354d47b8eef707da3faacc38de1..4fa129fc5c64d056d7b7c86936e95a47c1f086d8 100644 (file)
@@ -244,10 +244,10 @@ static inline void __iomem __must_check *
 vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, unsigned int bar)
 {
        if (WARN_ON_ONCE(bar >= PCI_STD_NUM_BARS))
-               return ERR_PTR(-EINVAL);
+               return IOMEM_ERR_PTR(-EINVAL);
 
        if (WARN_ON_ONCE(!vdev->barmap[bar]))
-               return ERR_PTR(-ENODEV);
+               return IOMEM_ERR_PTR(-ENODEV);
 
        return vdev->barmap[bar];
 }