mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] vpda: pds: fix building without debugfs
@ 2023-07-19 19:40 Arnd Bergmann
  2023-07-19 23:04 ` Shannon Nelson
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2023-07-19 19:40 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Shannon Nelson
  Cc: Arnd Bergmann, Xuan Zhuo, virtualization, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/vdpa/pds/debugfs.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/vdpa/pds/debugfs.h b/drivers/vdpa/pds/debugfs.h
index c088a4e8f1e92..6fbd64ace13a3 100644
--- a/drivers/vdpa/pds/debugfs.h
+++ b/drivers/vdpa/pds/debugfs.h
@@ -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_ */
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] vpda: pds: fix building without debugfs
  2023-07-19 19:40 [PATCH] vpda: pds: fix building without debugfs Arnd Bergmann
@ 2023-07-19 23:04 ` Shannon Nelson
  0 siblings, 0 replies; 2+ messages in thread
From: Shannon Nelson @ 2023-07-19 23:04 UTC (permalink / raw)
  To: Arnd Bergmann, Michael S. Tsirkin, Jason Wang
  Cc: Arnd Bergmann, Xuan Zhuo, virtualization, linux-kernel

On 7/19/23 12:40 PM, Arnd Bergmann wrote:
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, Arnd.  There is a patch already intended to address this:
https://lore.kernel.org/netdev/20230706231718.54198-1-shannon.nelson@amd.com/

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

sln


> ---
>   drivers/vdpa/pds/debugfs.h | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/vdpa/pds/debugfs.h b/drivers/vdpa/pds/debugfs.h
> index c088a4e8f1e92..6fbd64ace13a3 100644
> --- a/drivers/vdpa/pds/debugfs.h
> +++ b/drivers/vdpa/pds/debugfs.h
> @@ -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_ */
> --
> 2.39.2
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-19 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19 19:40 [PATCH] vpda: pds: fix building without debugfs Arnd Bergmann
2023-07-19 23:04 ` Shannon Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome