projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5ca734
)
ACPI: replace strlen("string") with sizeof("string") -1
author
Len Brown
<
[email protected]
>
Fri, 27 Jul 2012 01:32:01 +0000
(21:32 -0400)
committer
Len Brown
<
[email protected]
>
Fri, 27 Jul 2012 01:35:28 +0000
(21:35 -0400)
...both give the number of chars in the string
without the '\0', as strncmp() wants,
but sizeof() is compile-time.
Reported-by: Alan Stern <
[email protected]
>
Cc: Pavel Vasilyev <
[email protected]
>
Signed-off-by: Len Brown <
[email protected]
>
drivers/acpi/sysfs.c
patch
|
blob
|
history
diff --git
a/drivers/acpi/sysfs.c
b/drivers/acpi/sysfs.c
index 240a24400976929c663b9b3f8ce8bafa36435d5f..7c3f98ba4afefd00686fffc36283ad783a3e4798 100644
(file)
--- a/
drivers/acpi/sysfs.c
+++ b/
drivers/acpi/sysfs.c
@@
-173,7
+173,7
@@
static int param_set_trace_state(const char *val, struct kernel_param *kp)
{
int result = 0;
- if (!strncmp(val, "enable", s
trlen("enable")
)) {
+ if (!strncmp(val, "enable", s
izeof("enable") - 1
)) {
result = acpi_debug_trace(trace_method_name, trace_debug_level,
trace_debug_layer, 0);
if (result)
@@
-181,7
+181,7
@@
static int param_set_trace_state(const char *val, struct kernel_param *kp)
goto exit;
}
- if (!strncmp(val, "disable", s
trlen("disable")
)) {
+ if (!strncmp(val, "disable", s
izeof("disable") - 1
)) {
int name = 0;
result = acpi_debug_trace((char *)&name, trace_debug_level,
trace_debug_layer, 0);