]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vfio: unhide vdev->debug_root
authorArnd Bergmann <arnd@arndb.de>
Fri, 27 Mar 2026 16:55:08 +0000 (17:55 +0100)
committerAlex Williamson <alex@shazbot.org>
Mon, 30 Mar 2026 22:43:24 +0000 (16:43 -0600)
When debugfs is disabled, the hisilicon driver now fails to build:

drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c: In function 'hisi_acc_vfio_debug_init':
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c:1671:62: error: 'struct vfio_device' has no member named 'debug_root'
 1671 |         vfio_dev_migration = debugfs_lookup("migration", vdev->debug_root);
      |                                                              ^~

The driver otherwise relies on dead-code elimination, but this reference
fails. The single struct member is not going to make much of a difference
for memory consumption, so just keep this visible unconditionally.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b398f91779b8 ("hisi_acc_vfio_pci: register debugfs for hisilicon migration driver")
Link: https://lore.kernel.org/r/20260327165521.3779707-1-arnd@kernel.org
Signed-off-by: Alex Williamson <alex@shazbot.org>
include/linux/vfio.h

index 50b474334a1973c89dc6946485a1a8dd944b154e..31b826efba0008844bacd6bcffe1dabc3d28b904 100644 (file)
@@ -74,13 +74,11 @@ struct vfio_device {
        u8 iommufd_attached:1;
 #endif
        u8 cdev_opened:1;
-#ifdef CONFIG_DEBUG_FS
        /*
         * debug_root is a static property of the vfio_device
         * which must be set prior to registering the vfio_device.
         */
        struct dentry *debug_root;
-#endif
 };
 
 /**