Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291847
b: refs/heads/master
c: 8916e37
h: refs/heads/master
i:
  291845: 008adbd
  291843: 6df82ba
  291839: 78f3b13
v: v3
  • Loading branch information
Marcos Paulo de Souza authored and Rafael J. Wysocki committed Feb 9, 2012
1 parent dac47bc commit 04e0145
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ed3c7b559f3cae7a5a92860a127ceb0cafd5a9c
refs/heads/master: 8916e3702ec422b57cc549fbae3986106292100f
16 changes: 16 additions & 0 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ static inline void dpm_save_failed_step(enum suspend_stat_step step)
suspend_stats.last_failed_step %= REC_FAILED_NUM;
}

/**
* suspend_stats_update - Update success/failure statistics of suspend-to-ram
*
* @error: Value returned by enter_state() function
*/
static inline void suspend_stats_update(int error)
{
if (error) {
suspend_stats.fail++;
dpm_save_failed_errno(error);
} else {
suspend_stats.success++;
}
}


/**
* struct platform_suspend_ops - Callbacks for managing platform dependent
* system sleep states.
Expand Down
6 changes: 1 addition & 5 deletions trunk/kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,7 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
}
if (state < PM_SUSPEND_MAX && *s) {
error = enter_state(state);
if (error) {
suspend_stats.fail++;
dpm_save_failed_errno(error);
} else
suspend_stats.success++;
suspend_stats_update(error);
}
#endif

Expand Down
6 changes: 1 addition & 5 deletions trunk/kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@ int pm_suspend(suspend_state_t state)
int ret;
if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) {
ret = enter_state(state);
if (ret) {
suspend_stats.fail++;
dpm_save_failed_errno(ret);
} else
suspend_stats.success++;
suspend_stats_update(ret);
return ret;
}
return -EINVAL;
Expand Down

0 comments on commit 04e0145

Please sign in to comment.