提交 8cff6679 编写于 作者: G Geert Uytterhoeven 提交者: Rafael J. Wysocki

PM / sleep: Fix test_suspend after sleep state rework

When passing "test_suspend=mem" to the kernel:

    PM: can't test 'mem' suspend state

and the suspend test is not run.

Commit 406e7938 ("PM / sleep: System sleep state selection
interface rework") changed pm_labels[] from a contiguous NULL-terminated
array to a sparse array (with the first element unpopulated), breaking
the assumptions of the iterator in setup_test_suspend().

Iterate from PM_SUSPEND_MIN to PM_SUSPEND_MAX - 1 to fix this.

Fixes: 406e7938 (PM / sleep: System sleep state selection interface rework)
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 858a0d7e
...@@ -166,7 +166,7 @@ static int __init setup_test_suspend(char *value) ...@@ -166,7 +166,7 @@ static int __init setup_test_suspend(char *value)
return 0; return 0;
} }
for (i = 0; pm_labels[i]; i++) for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++)
if (!strcmp(pm_labels[i], suspend_type)) { if (!strcmp(pm_labels[i], suspend_type)) {
test_state_label = pm_labels[i]; test_state_label = pm_labels[i];
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册