hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/kernel/power/suspend_test.c
....@@ -1,9 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * kernel/power/suspend_test.c - Suspend to RAM and standby test facility.
34 *
45 * Copyright (c) 2009 Pavel Machek <pavel@ucw.cz>
5
- *
6
- * This file is released under the GPLv2.
76 */
87
98 #include <linux/init.h>
....@@ -71,7 +70,7 @@
7170 static char info_test[] __initdata =
7271 KERN_INFO "PM: test RTC wakeup from '%s' suspend\n";
7372
74
- unsigned long now;
73
+ time64_t now;
7574 struct rtc_wkalrm alm;
7675 int status;
7776
....@@ -82,10 +81,10 @@
8281 printk(err_readtime, dev_name(&rtc->dev), status);
8382 return;
8483 }
85
- rtc_tm_to_time(&alm.time, &now);
84
+ now = rtc_tm_to_time64(&alm.time);
8685
8786 memset(&alm, 0, sizeof alm);
88
- rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time);
87
+ rtc_time64_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time);
8988 alm.enabled = true;
9089
9190 status = rtc_set_alarm(rtc, &alm);
....@@ -158,22 +157,22 @@
158157 value++;
159158 suspend_type = strsep(&value, ",");
160159 if (!suspend_type)
161
- return 0;
160
+ return 1;
162161
163162 repeat = strsep(&value, ",");
164163 if (repeat) {
165164 if (kstrtou32(repeat, 0, &test_repeat_count_max))
166
- return 0;
165
+ return 1;
167166 }
168167
169168 for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++)
170169 if (!strcmp(pm_labels[i], suspend_type)) {
171170 test_state_label = pm_labels[i];
172
- return 0;
171
+ return 1;
173172 }
174173
175174 printk(warn_bad_state, suspend_type);
176
- return 0;
175
+ return 1;
177176 }
178177 __setup("test_suspend", setup_test_suspend);
179178