Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: fix acpi_debugfs_init prototype

acpi_debugfs_init function is declared with return type int in
drivers/acpi/internal.h when CONFIG_DEBUG_FS is enabled, but its
definition in drivers/acpi/debugfs.c has return type void. This is due
to commit aecad432fd68 ("ACPI: Cleanup custom_method debug stuff"),
which changed the return type from int to void without updating the
declaration.

Fix this inconsistency by updating acpi_debugfs_init prototype. While
at it, include internal.h in debugfs.c so that the compiler can check
that the declaration and definition remain compatible.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Nicolas Iooss and committed by
Rafael J. Wysocki
10742619 4c62dbbc

+3 -1
+2
drivers/acpi/debugfs.c
··· 7 7 #include <linux/debugfs.h> 8 8 #include <linux/acpi.h> 9 9 10 + #include "internal.h" 11 + 10 12 #define _COMPONENT ACPI_SYSTEM_COMPONENT 11 13 ACPI_MODULE_NAME("debugfs"); 12 14
+1 -1
drivers/acpi/internal.h
··· 67 67 68 68 #ifdef CONFIG_DEBUG_FS 69 69 extern struct dentry *acpi_debugfs_dir; 70 - int acpi_debugfs_init(void); 70 + void acpi_debugfs_init(void); 71 71 #else 72 72 static inline void acpi_debugfs_init(void) { return; } 73 73 #endif