summaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2016-02-23 17:49:17 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 00:36:03 +0100
commit6954d43292674aaacc9b1cdbc28b1b2ea0cc6445 (patch)
treee815e356bb26d68f2aaab353aee77df172859557 /drivers/base/power
parentPM / Domains: remove old power on/off latencies (diff)
downloadlinux-6954d43292674aaacc9b1cdbc28b1b2ea0cc6445.tar.xz
linux-6954d43292674aaacc9b1cdbc28b1b2ea0cc6445.zip
PM / Domains: Restore alignment of slaves in debugfs output
The slave domains are no longer aligned with the table header in the /sys/kernel/debug/pm_genpd/pm_genpd_summary output. Worse, the alignment differs depending on the actual name of the state. Format the state name and index into a buffer, and print that like before to restore alignment. Use "%u" for unsigned int while we're at it. Fixes: fc5cbf0c94b6f7fd (PM / Domains: Support for multiple states) Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/domain.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index e8ca290dbf9d..01015d85ab64 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1882,6 +1882,7 @@ static int pm_genpd_summary_one(struct seq_file *s,
struct pm_domain_data *pm_data;
const char *kobj_path;
struct gpd_link *link;
+ char state[16];
int ret;
ret = mutex_lock_interruptible(&genpd->lock);
@@ -1890,12 +1891,13 @@ static int pm_genpd_summary_one(struct seq_file *s,
if (WARN_ON(genpd->status >= ARRAY_SIZE(status_lookup)))
goto exit;
- seq_printf(s, "%-30s %s", genpd->name, status_lookup[genpd->status]);
-
if (genpd->status == GPD_STATE_POWER_OFF)
- seq_printf(s, " %-13d ", genpd->state_idx);
+ snprintf(state, sizeof(state), "%s %u",
+ status_lookup[genpd->status], genpd->state_idx);
else
- seq_printf(s, " %-15s ", "");
+ snprintf(state, sizeof(state), "%s",
+ status_lookup[genpd->status]);
+ seq_printf(s, "%-30s %-15s ", genpd->name, state);
/*
* Modifications on the list require holding locks on both