Re: [Xen-devel] [PATCH] xenbus: Neaten xenbus_va_dev_error
On Wed, 2017-02-08 at 12:14 -0500, Boris Ostrovsky wrote: > On 02/08/2017 11:05 AM, Joe Perches wrote: > > On Wed, 2017-02-08 at 10:33 -0500, Boris Ostrovsky wrote: > > > On 02/08/2017 06:33 AM, Joe Perches wrote: > > > > This function error patch can be simplified, so do so. > > > > > > > > Remove fail: label and somewhat obfuscating, used once "error_path" > > > > function. > > > > btw: I left it alone, but likely > > > > #define PRINTF_BUFFER_SIZE 4096 > > > > is probably excessive as the maximum printk > > buffer is 1024. > > > > The xenbus_write might be longer though so > > maybe it's OK to use 4096, but there is some > > inequivalence there. > > > > xenbus_write() handles writes up to 4K. However we are filling the > buffer with sprintf() which I assume is limited to 1K too vsnprintf is bounded only by addressable memory. ie: (void *)-1 > so it indeed > doesn't seem useful to have PRINTF_BUFFER_SIZE set to 4. > > -boris > ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] xenbus: Neaten xenbus_va_dev_error
On 02/08/2017 11:05 AM, Joe Perches wrote: > On Wed, 2017-02-08 at 10:33 -0500, Boris Ostrovsky wrote: >> On 02/08/2017 06:33 AM, Joe Perches wrote: >>> This function error patch can be simplified, so do so. >>> >>> Remove fail: label and somewhat obfuscating, used once "error_path" >>> function. > btw: I left it alone, but likely > > #define PRINTF_BUFFER_SIZE 4096 > > is probably excessive as the maximum printk > buffer is 1024. > > The xenbus_write might be longer though so > maybe it's OK to use 4096, but there is some > inequivalence there. > xenbus_write() handles writes up to 4K. However we are filling the buffer with sprintf() which I assume is limited to 1K too so it indeed doesn't seem useful to have PRINTF_BUFFER_SIZE set to 4. -boris ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] xenbus: Neaten xenbus_va_dev_error
On Wed, 2017-02-08 at 10:33 -0500, Boris Ostrovsky wrote: > On 02/08/2017 06:33 AM, Joe Perches wrote: > > This function error patch can be simplified, so do so. > > > > Remove fail: label and somewhat obfuscating, used once "error_path" > > function. btw: I left it alone, but likely #define PRINTF_BUFFER_SIZE 4096 is probably excessive as the maximum printk buffer is 1024. The xenbus_write might be longer though so maybe it's OK to use 4096, but there is some inequivalence there. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] xenbus: Neaten xenbus_va_dev_error
On 02/08/2017 06:33 AM, Joe Perches wrote: > This function error patch can be simplified, so do so. > > Remove fail: label and somewhat obfuscating, used once "error_path" > function. > > Signed-off-by: Joe PerchesApplied to for-linus-4.11. -boris ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel