Skip to contentSkip to conversation

vpda: pds: fix building without debugfs

PATCH In review Arnd Bergmann 2 participants 2 messages Jul 19, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vpda: pds: fix building without debugfs

From: Arnd Bergmann <[email protected]>

The new debugfs code still gets called when debugfs is disabled, resulting in a link failure:

ERROR: modpost: "pds_vdpa_debugfs_del_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_reset_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_create" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_ident" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_destroy" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_pcidev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!

Add the usual #if/#else block around the declarations to supply empty stubs for the broken case.

Fixes 151cc834f3dda ("pds_vdpa: add support for vdpa and vdpamgmt interfaces")
---
 drivers/vdpa/pds/debugfs.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/vdpa/pds/debugfs.h +10 -0
index c088a4e8f1e92..6fbd64ace13a3 100644
@@ -6,6 +6,7 @@
 
 #include <linux/debugfs.h>
 
+#ifdef CONFIG_DEBUG_FS
 void pds_vdpa_debugfs_create(void);
 void pds_vdpa_debugfs_destroy(void);
 void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux);
@@ -13,5 +14,14 @@ void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux);
 void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux);
 void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux);
 void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux);
+#else
+static inline void pds_vdpa_debugfs_create(void) { }
+static inline void pds_vdpa_debugfs_destroy(void) { }
+static inline void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+#endif
 
 #endif /* _PDS_VDPA_DEBUGFS_H_ */
Signature · 1 line
2.39.2
#1 lore raw
Quoted 14 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The new debugfs code still gets called when debugfs is disabled, resulting in a link failure:

ERROR: modpost: "pds_vdpa_debugfs_del_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_reset_vdpadev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_create" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_ident" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_destroy" [drivers/vdpa/pds/pds_vdpa.ko] undefined!
ERROR: modpost: "pds_vdpa_debugfs_add_pcidev" [drivers/vdpa/pds/pds_vdpa.ko] undefined!

Quoted 5 lines

Add the usual #if/#else block around the declarations to supply empty stubs for the broken case.

Fixes 151cc834f3dda ("pds_vdpa: add support for vdpa and vdpamgmt interfaces")

Thanks, Arnd. There is a patch already intended to address this:
https://lore.kernel.org/netdev/[email protected]/

Maybe it needs to get pulled in through a different tree to show up quicker?

sln

Quoted 32 lines
---
  drivers/vdpa/pds/debugfs.h | 10 ++++++++++
  1 file changed, 10 insertions(+)
drivers/vdpa/pds/debugfs.h +10 -1
index c088a4e8f1e92..6fbd64ace13a3 100644
@@ -6,6 +6,7 @@
 
  #include <linux/debugfs.h>
 
+#ifdef CONFIG_DEBUG_FS
  void pds_vdpa_debugfs_create(void);
  void pds_vdpa_debugfs_destroy(void);
  void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux);
@@ -13,5 +14,14 @@ void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux);
  void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux);
  void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux);
  void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux);
+#else
+static inline void pds_vdpa_debugfs_create(void) { }
+static inline void pds_vdpa_debugfs_destroy(void) { }
+static inline void pds_vdpa_debugfs_add_pcidev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_add_ident(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_add_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_del_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+static inline void pds_vdpa_debugfs_reset_vdpadev(struct pds_vdpa_aux *vdpa_aux) { }
+#endif
 
  #endif /* _PDS_VDPA_DEBUGFS_H_ */
--
Quoted 2 lines

2.39.2

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization