Skip to content

Commit 1f464cb

Browse files
Liao Changrafaeljw
authored andcommitted
cpufreq: Avoid printing kernel addresses in cpufreq_resume()
The pointer value of policy and driver structure are currently printed in the error messages of cpufreq_resume(), this is not recommended and helpful. In order to be consistent with the error message in cpufreq_suspend() and easier to understand, print the name of driver strcture and the manage CPU of policy structure individually in the error messages of cpufreq_resume(). Link: https://lore.kernel.org/all/b7be717c-41d8-bbbf-3e97-3799948ab757@huawei.com Signed-off-by: Liao Chang <liaochang1@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ccc5e98 commit 1f464cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,16 +1943,16 @@ void cpufreq_resume(void)
19431943

19441944
for_each_active_policy(policy) {
19451945
if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {
1946-
pr_err("%s: Failed to resume driver: %p\n", __func__,
1947-
policy);
1946+
pr_err("%s: Failed to resume driver: %s\n", __func__,
1947+
cpufreq_driver->name);
19481948
} else if (has_target()) {
19491949
down_write(&policy->rwsem);
19501950
ret = cpufreq_start_governor(policy);
19511951
up_write(&policy->rwsem);
19521952

19531953
if (ret)
1954-
pr_err("%s: Failed to start governor for policy: %p\n",
1955-
__func__, policy);
1954+
pr_err("%s: Failed to start governor for CPU%u's policy\n",
1955+
__func__, policy->cpu);
19561956
}
19571957
}
19581958
}

0 commit comments

Comments
 (0)