Skip to content

Commit 83f5ad5

Browse files
Su Huirafaeljw
authored andcommitted
ACPI: OSL: add __printf format attribute to acpi_os_vprintf()
With gcc and W=1 option to compile the kernel, warning occurs: 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]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ce9ecca commit 83f5ad5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/osl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void acpi_os_printf(const char *fmt, ...)
149149
}
150150
EXPORT_SYMBOL(acpi_os_printf);
151151

152-
void acpi_os_vprintf(const char *fmt, va_list args)
152+
void __printf(1, 0) acpi_os_vprintf(const char *fmt, va_list args)
153153
{
154154
static char buffer[512];
155155

0 commit comments

Comments
 (0)