Skip to content

Commit 92fd356

Browse files
Chen ZhouVasily Gorbik
authored andcommitted
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/[email protected] Signed-off-by: Chen Zhou <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent df8cea2 commit 92fd356

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/kernel/ipl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static ssize_t sys_##_prefix##_##_name##_show(struct kobject *kobj, \
181181
struct kobj_attribute *attr, \
182182
char *page) \
183183
{ \
184-
return snprintf(page, PAGE_SIZE, _format, ##args); \
184+
return scnprintf(page, PAGE_SIZE, _format, ##args); \
185185
}
186186

187187
#define IPL_ATTR_CCW_STORE_FN(_prefix, _name, _ipl_blk) \

0 commit comments

Comments
 (0)