Commit 2231f78d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b730bab0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ enum suspend_stat_step {

struct suspend_stats {
	unsigned int step_failures[SUSPEND_NR_STEPS];
	int	success;
	int	fail;
	unsigned int success;
	unsigned int fail;
#define	REC_FAILED_NUM	2
	int	last_failed_dev;
	char	failed_devs[REC_FAILED_NUM][40];
+3 −3
Original line number Diff line number Diff line
@@ -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++)