misc: enclosure: replace snprintf in show functions with sysfs_emit
authorYe Guojin <ye.guojin@zte.com.cn>
Fri, 22 Oct 2021 09:06:04 +0000 (09:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Oct 2021 09:25:39 +0000 (11:25 +0200)
commit714f1af14bb0c829a33ad68c4ef7d622618ce702
tree42b07141e0625114e713c5ee6603eded2f68a26f
parent5a5846fdd312c82d3594e99c7e2416fa0495cf6c
misc: enclosure: replace snprintf in show functions with sysfs_emit

coccicheck complains about the use of snprintf() in sysfs show
functions:
WARNING  use scnprintf or sprintf

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
Link: https://lore.kernel.org/r/20211022090604.1065367-1-ye.guojin@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/enclosure.c