Commit d30bdfc0 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Rafael J. Wysocki

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: default avatarChuhong Yuan <hslester96@gmail.com>
[ rjw: Subject & changelog ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 2c8db5be
......@@ -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
......
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