]> git.baikalelectronics.ru Git - kernel.git/commit
macintosh/ams: Replace snprintf in show functions with sysfs_emit
authorQing Wang <wangqing@vivo.com>
Fri, 15 Oct 2021 06:49:04 +0000 (23:49 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 May 2022 09:37:45 +0000 (19:37 +1000)
commitb4c4cf6ade084073103c775f4d58b641da08cfd2
tree66545be2021d02fb9654af84d775131a2124cf8a
parent0f1a3165b8b43b8adca617485758fe1f16a3cb57
macintosh/ams: Replace snprintf in show functions with sysfs_emit

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

Fix the following coccicheck warning:
  drivers/macintosh/ams/ams-core.c:53: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <wangqing@vivo.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1634280544-4581-1-git-send-email-wangqing@vivo.com
drivers/macintosh/ams/ams-core.c