]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: panasonic-laptop: Replace snprintf in show functions with sysfs_emit
authorQing Wang <wangqing@vivo.com>
Fri, 15 Oct 2021 06:50:40 +0000 (23:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:51 +0000 (19:50 +0100)
commit0f7f31aaf61321cce092c8a7d440c0028599fb55
tree4ed881fd6856f49c8074415e8a18934a363eaff5
parent4676e50444046b498555b849e6080a5c78cdda9b
platform/x86: panasonic-laptop: Replace snprintf in show functions with sysfs_emit

[ Upstream commit 2d5b0755b754fcb39598df87b3a8656a569e9979 ]

show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the coccicheck warnings:
WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1634280641-4862-1-git-send-email-wangqing@vivo.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Stable-dep-of: 5c7bebc1a3f0 ("platform/x86: panasonic-laptop: Return errno correctly in show callback")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/panasonic-laptop.c