Commit 0bff1d9f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Zheng Zengkai
Browse files

PM: wakeup: simplify the output logic of pm_show_wakelocks()

stable inclusion
from stable-v5.10.96
commit 561a22d44acc3914d65c9a995540945b0c6b766d
bugzilla: https://gitee.com/openeuler/kernel/issues/I55NWB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=561a22d44acc3914d65c9a995540945b0c6b766d



--------------------------------

commit c9d967b2 upstream.

The buffer handling in pm_show_wakelocks() is tricky, and hopefully
correct.  Ensure it really is correct by using sysfs_emit_at() which
handles all of the tricky string handling logic in a PAGE_SIZE buffer
for us automatically as this is a sysfs file being read from.

Reviewed-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent fc154e52
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment