Message ID | 577E282002000078000FBECB@prv-mh.provo.novell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 07/07/16 09:00, Jan Beulich wrote:
> ... as being the simpler variant.
It's really annoying that all these related cleanups where not in the
same thread. Don't do this again, please.
The better clean-up is to remove xenbus_write() in favour of
xenbus_printf() everywhere (especially since one of your "cleanups" made
it worse).
xenbus_printf() does everything xenbus_write() can do with no loss of
readability.
David
>>> On 07.07.16 at 13:12, <david.vrabel@citrix.com> wrote: > The better clean-up is to remove xenbus_write() in favour of > xenbus_printf() everywhere (especially since one of your "cleanups" made > it worse). I don't think I've seen any reply indicating something has got made worse. The fact that in one case I left the xenbus_printf() in place despite having replaced the format string by one without % specifier didn't result in a bug at all. > xenbus_printf() does everything xenbus_write() can do with no loss of > readability. Yet with quite a bit higher overhead. Readability is not the point here. Jan
--- 4.7-rc6-prefer-xenbus_write.orig/drivers/net/xen-netfront.c +++ 4.7-rc6-prefer-xenbus_write/drivers/net/xen-netfront.c @@ -1886,26 +1886,25 @@ again: } /* The remaining keys are not queue-specific */ - err = xenbus_printf(xbt, dev->nodename, "request-rx-copy", "%u", - 1); + err = xenbus_write(xbt, dev->nodename, "request-rx-copy", "1"); if (err) { message = "writing request-rx-copy"; goto abort_transaction; } - err = xenbus_printf(xbt, dev->nodename, "feature-rx-notify", "%d", 1); + err = xenbus_write(xbt, dev->nodename, "feature-rx-notify", "1"); if (err) { message = "writing feature-rx-notify"; goto abort_transaction; } - err = xenbus_printf(xbt, dev->nodename, "feature-sg", "%d", 1); + err = xenbus_write(xbt, dev->nodename, "feature-sg", "1"); if (err) { message = "writing feature-sg"; goto abort_transaction; } - err = xenbus_printf(xbt, dev->nodename, "feature-gso-tcpv4", "%d", 1); + err = xenbus_write(xbt, dev->nodename, "feature-gso-tcpv4", "1"); if (err) { message = "writing feature-gso-tcpv4"; goto abort_transaction;
... as being the simpler variant. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- drivers/net/xen-netfront.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)