summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-08-09 15:10:23 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-08-16 14:18:53 +0200
commitd30bdfc0ecf885ca0495bdee522cb9d7ee005cf8 (patch)
treee30309fba97560d851c6fc45f0474de8c02425ab /kernel/power
parent2c8db5bef9fb442a5a0d2fee28aed20100362ce3 (diff)
PM: sleep: Replace strncmp() with str_has_prefix()
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>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 938dc53a8b94..e8710d179b35 100644
--- 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