mirror of https://gitee.com/openkylin/linux.git
s390: use scnprintf() in sys_##_prefix##_##_name##_show
snprintf() returns the number of bytes that would be written, which may be greater than the the actual length to be written. show() methods should return the number of bytes printed into the buffer. This is the return value of scnprintf(). Link: https://lkml.kernel.org/r/20200509085608.41061-3-chenzhou10@huawei.com Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
df8cea2a4b
commit
92fd356514
|
@ -181,7 +181,7 @@ static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \
|
|||
struct kobj_attribute *attr, \
|
||||
char *page) \
|
||||
{ \
|
||||
return snprintf(page, PAGE_SIZE, _format, ##args); \
|
||||
return scnprintf(page, PAGE_SIZE, _format, ##args); \
|
||||
}
|
||||
|
||||
#define IPL_ATTR_CCW_STORE_FN(_prefix, _name, _ipl_blk) \
|
||||
|
|
Loading…
Reference in New Issue