projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c8db5b
)
PM: sleep: Replace strncmp() with str_has_prefix()
author
Chuhong Yuan
<hslester96@gmail.com>
Fri, 9 Aug 2019 07:10:23 +0000
(15:10 +0800)
committer
Rafael J. Wysocki
<rafael.j.wysocki@intel.com>
Fri, 16 Aug 2019 12:18:53 +0000
(14:18 +0200)
Use str_has_prefix() instead of strncmp() which is less
straightforward in decode_state().
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/main.c
patch
|
blob
|
history
diff --git
a/kernel/power/main.c
b/kernel/power/main.c
index
938dc53
..
e8710d1
100644
(file)
--- a/
kernel/power/main.c
+++ b/
kernel/power/main.c
@@
-580,7
+580,7
@@
static suspend_state_t decode_state(const char *buf, size_t n)
len = p ? p - buf : n;
/* Check hibernation first. */
- if (len == 4 &&
!strncmp(buf, "disk", len
))
+ if (len == 4 &&
str_has_prefix(buf, "disk"
))
return PM_SUSPEND_MAX;
#ifdef CONFIG_SUSPEND