platform/x86: wmi: use sizeof() instead of hard-coding
RFC PATCH 17/30 platform/x86: wmi: use sizeof() instead of hard-coding
Avoid hard-coding the buffer size in an snprintf() call by using sizeof() to retrieve the size.
Signed-off-by Barnabás Pőcze <[email protected]>
--- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/wmi.c +1 -1
@@ -189,7 +189,7 @@ static acpi_status wmi_method_enable(struct wmi_block *wblock, bool enable) block = &wblock->gblock; handle = wblock->acpi_device->handle; -snprintf (method,5 ,"WE%02X" , block->notify_id); +snprintf (method,sizeof (method),"WE%02X" , block->notify_id); status =acpi_execute_simple_method (handle, method, enable);if (status !=AE_OK && status !=AE_NOT_FOUND )
--
2.33.0