mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 12:50:35 +07:00
abfc19ff20
According to the documentation[1] show() methods of device attributes should return the number of bytes printed into the buffer. This is the return value of scnprintf(). show() must not use snprintf() when formatting the value to be returned to user space. snprintf() returns the length the resulting string would be, assuming it all fit into the destination array[2]. scnprintf() return the length of the string actually created in buf. If one can guarantee that an overflow will never happen sprintf() can be used otherwise scnprintf(). [1] Documentation/filesystems/sysfs.txt [2] "snprintf() confusion" https://lwn.net/Articles/69419/ Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> |
||
---|---|---|
.. | ||
alloc | ||
debugfs | ||
atomic_as_refcounter.cocci | ||
check_bq27xxx_data.cocci | ||
d_find_alias.cocci | ||
device_attr_show.cocci | ||
err_cast.cocci | ||
kstrdup.cocci | ||
memdup_user.cocci | ||
memdup.cocci | ||
platform_get_irq.cocci | ||
platform_no_drv_owner.cocci | ||
pm_runtime.cocci | ||
ptr_ret.cocci | ||
resource_size.cocci | ||
simple_open.cocci | ||
stream_open.cocci | ||
vma_pages.cocci |