Commit 869639f9 authored by Len Brown's avatar Len Brown

ACPI: replace strlen("string") with sizeof("string") -1

...both give the number of chars in the string
without the '\0', as strncmp() wants,
but sizeof() is compile-time.
Reported-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: Pavel Vasilyev <pavel@pavlinux.ru>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent a5ca7345
...@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) ...@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
{ {
int result = 0; int result = 0;
if (!strncmp(val, "enable", strlen("enable"))) { if (!strncmp(val, "enable", sizeof("enable") - 1)) {
result = acpi_debug_trace(trace_method_name, trace_debug_level, result = acpi_debug_trace(trace_method_name, trace_debug_level,
trace_debug_layer, 0); trace_debug_layer, 0);
if (result) if (result)
...@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp) ...@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
goto exit; goto exit;
} }
if (!strncmp(val, "disable", strlen("disable"))) { if (!strncmp(val, "disable", sizeof("disable") - 1)) {
int name = 0; int name = 0;
result = acpi_debug_trace((char *)&name, trace_debug_level, result = acpi_debug_trace((char *)&name, trace_debug_level,
trace_debug_layer, 0); trace_debug_layer, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment