Hi,
On 2023/4/4 22:10, Emil Velikov wrote:
--- /dev/null +++ b/drivers/gpu/drm/loongson/lsdc_debugfs.c +void lsdc_debugfs_init(struct drm_minor *minor) +{ +#ifdef CONFIG_DEBUG_FS
drm_debugfs_create_files(lsdc_debugfs_list,
ARRAY_SIZE(lsdc_debugfs_list),
minor->debugfs_root,
minor);
+#endif +}
Should probably build the file when debugfs is enabled and provide no-op stub in the header. See nouveau for an example.
But doing that way introduce duplication, you actually write two implements for the same function prototype.
One for the real, another one for the dummy.
Typically skilled core framework programmer/writer like it, for multiple backend and multiple arch support
Because the functions set need to be implemented is large for those cases.
While we are just a driver implement based the drm core and only one single function here,
DEBUG_FS is enabled by default on our Mips and Loongarch. It is not suffer from high frequency changes.
In this case , CONFIG_DEBUG_FS just boils down to "true", a nearly always enabled decoration.
We do implement debugfs support that way in the before[1], but we pursue compact in the afterwards.
We could revise our driver if that is strongly recommended.