ACPI: OSL: add __printf format attribute to acpi_os_vprintf
Subsystems (2)
PATCH 2/2 ACPI: OSL: add __printf format attribute to acpi_os_vprintf
With gcc and W=1 option to compile kernel, warning happends:
drivers/acpi/osl.c:156:2: error:
function ‘acpi_os_vprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format].
Allow the compiler to recognize and check format strings is safer.
--- drivers/acpi/osl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/osl.c +1 -1
@@ -149,7 +149,7 @@ void acpi_os_printf(const char *fmt, ...) }EXPORT_SYMBOL (acpi_os_printf); -void acpi_os_vprintf (const char *fmt,va_list args) +void __printf(1, 0) acpi_os_vprintf(const char *fmt, va_list args) { static char buffer[512];
Signature · 1 line
2.30.2
Rafael J. Wysocki
maintainerQuoted 19 lines · Su Hui
With gcc and W=1 option to compile kernel, warning happends:
drivers/acpi/osl.c:156:2: error:
function ‘acpi_os_vprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format].Allow the compiler to recognize and check format strings is safer.
Signed-off-by Su Hui <[email protected]>--- drivers/acpi/osl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/osl.c +0
-0
drivers/acpi/osl.c void acpi_os_printf(const char *fmt, ...)
Quoted 9 lines
drivers/acpi/osl.c +1
-2@@ -149,7 +149,7 @@ void acpi_os_printf(const char *fmt, ...) }EXPORT_SYMBOL (acpi_os_printf); -void acpi_os_vprintf (const char *fmt,va_list args) +void __printf(1, 0) acpi_os_vprintf(const char *fmt, va_list args) { static char buffer[512]; --
Applied (with some subject and changelog edits) as 6.7 material, thanks!