Re: [PATCH -next 0/2] sparc: use snprintf() in show() methods

2020-05-13 Thread David Miller
From: Chen Zhou Date: Sat, 9 May 2020 17:18:47 +0800 > 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

Re: [PATCH -next 0/2] sparc: use snprintf() in show() methods

2020-05-10 Thread Joe Perches
On Mon, 2020-05-11 at 09:24 +0800, chenzhou wrote: > Sorry, i made a mistake, should be scnprintf(). No worries. But why do you think this is useful? Is it likely that either snprint length will exceed PAGE_SIZE? > > On 2020/5/9 19:40, Joe Perches wrote: > > On Sat, 2020-05-09 at 17:18 +0800, C

Re: [PATCH -next 0/2] sparc: use snprintf() in show() methods

2020-05-10 Thread chenzhou
Sorry, i made a mistake, should be scnprintf(). On 2020/5/9 19:40, Joe Perches wrote: > On Sat, 2020-05-09 at 17:18 +0800, Chen Zhou wrote: >> snprintf() returns the number of bytes that would be written, >> which may be greater than the the actual length to be written. > [] >> Chen Zhou (2): >>

Re: [PATCH -next 0/2] sparc: use snprintf() in show() methods

2020-05-09 Thread Joe Perches
On Sat, 2020-05-09 at 17:18 +0800, Chen Zhou wrote: > snprintf() returns the number of bytes that would be written, > which may be greater than the the actual length to be written. [] > Chen Zhou (2): > sparc: use snprintf() in show_pciobppath_attr() in pci.c > sparc: use snprintf() in show_pci

[PATCH -next 0/2] sparc: use snprintf() in show() methods

2020-05-09 Thread Chen Zhou
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(). Chen Zhou (2): sparc: use snprintf() in sho