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 <suhui@nfschina.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Su Hui 2023-08-31 15:34:56 +08:00 committed by Rafael J. Wysocki
parent ce9ecca023
commit 83f5ad58da

View File

@ -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];