diff mbox

xen-netfront: prefer xenbus_write() over xenbus_printf() where possible

Message ID 577E282002000078000FBECB@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich July 7, 2016, 8 a.m. UTC
... 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(-)

Comments

David Vrabel July 7, 2016, 11:12 a.m. UTC | #1
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
Jan Beulich July 7, 2016, 12:05 p.m. UTC | #2
>>> 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
diff mbox

Patch

--- 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;