Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a6b227d

Browse files
yghannambp3tk0v
authored andcommitted
RAS: Avoid build errors when CONFIG_DEBUG_FS=n
A new helper was introduced for RAS modules to be able to get the RAS subsystem debugfs root directory. The helper is defined in debugfs.c which is only built when CONFIG_DEBUG_FS=y. However, it's possible that the modules would include debugfs support for optional functionality. One current example is the fmpm module. In this case, a build error will occur when CONFIG_RAS_FMPM is selected and CONFIG_DEBUG_FS=n. Add an inline helper function stub for the CONFIG_DEBUG_FS=n case as the fmpm module can function without the debugfs functionality too. Fixes: 9d2b6fa ("RAS: Export helper to get ras_debugfs_dir") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218640 Reported-by: anthony s. knowles <akira.2020@protonmail.com> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Tested-by: anthony s. knowles <akira.2020@protonmail.com> Link: https://lore.kernel.org/r/20240325183755.776-1-bp@alien8.de
1 parent 9b19543 commit a6b227d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/ras/debugfs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#include <linux/debugfs.h>
66

7+
#if IS_ENABLED(CONFIG_DEBUG_FS)
78
struct dentry *ras_get_debugfs_root(void);
9+
#else
10+
static inline struct dentry *ras_get_debugfs_root(void) { return NULL; }
11+
#endif /* DEBUG_FS */
812

913
#endif /* __RAS_DEBUGFS_H__ */

0 commit comments

Comments
 (0)