summaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-01-29 17:13:14 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-05 14:26:27 +0100
commit2231f78d3e15e45abe534db1997bc6a2153dc01c (patch)
tree750cdb2b88eb46de1d99e252cc5b46720eae8301 /kernel/power
parentPM: sleep: stats: Use an array of step failure counters (diff)
downloadlinux-2231f78d3e15e45abe534db1997bc6a2153dc01c.tar.xz
linux-2231f78d3e15e45abe534db1997bc6a2153dc01c.zip
PM: sleep: stats: Use unsigned int for success and failure counters
Change the type of the "success" and "fail" fields in struct suspend_stats to unsigned int, because they cannot be negative. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index d7a02105b183..d6b4a9258288 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -339,8 +339,8 @@ static ssize_t _name##_show(struct kobject *kobj, \
} \
static struct kobj_attribute _name = __ATTR_RO(_name)
-suspend_attr(success, "%d\n");
-suspend_attr(fail, "%d\n");
+suspend_attr(success, "%u\n");
+suspend_attr(fail, "%u\n");
suspend_attr(last_hw_sleep, "%llu\n");
suspend_attr(total_hw_sleep, "%llu\n");
suspend_attr(max_hw_sleep, "%llu\n");
@@ -458,7 +458,7 @@ static int suspend_stats_show(struct seq_file *s, void *unused)
last_step = suspend_stats.last_failed_step + REC_FAILED_NUM - 1;
last_step %= REC_FAILED_NUM;
- seq_printf(s, "success: %d\nfail: %d\n",
+ seq_printf(s, "success: %u\nfail: %u\n",
suspend_stats.success, suspend_stats.fail);
for (step = SUSPEND_FREEZE; step <= SUSPEND_NR_STEPS; step++)