xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen-netback: prefer xenbus_write() over xenbus_printf() where possible
@ 2016-07-07  7:58 Jan Beulich
  2016-07-07  8:27 ` Paul Durrant
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Beulich @ 2016-07-07  7:58 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, netdev

... as being the simpler variant.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/net/xen-netback/xenbus.c |   24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

--- 4.7-rc6-prefer-xenbus_write.orig/drivers/net/xen-netback/xenbus.c
+++ 4.7-rc6-prefer-xenbus_write/drivers/net/xen-netback/xenbus.c
@@ -301,17 +301,15 @@ static int netback_probe(struct xenbus_d
 		}
 
 		/* We support partial checksum setup for IPv6 packets */
-		err = xenbus_printf(xbt, dev->nodename,
-				    "feature-ipv6-csum-offload",
-				    "%d", 1);
+		err = xenbus_write(xbt, dev->nodename,
+				   "feature-ipv6-csum-offload", "1");
 		if (err) {
 			message = "writing feature-ipv6-csum-offload";
 			goto abort_transaction;
 		}
 
 		/* We support rx-copy path. */
-		err = xenbus_printf(xbt, dev->nodename,
-				    "feature-rx-copy", "%d", 1);
+		err = xenbus_write(xbt, dev->nodename, "feature-rx-copy", "1");
 		if (err) {
 			message = "writing feature-rx-copy";
 			goto abort_transaction;
@@ -321,24 +319,22 @@ static int netback_probe(struct xenbus_d
 		 * We don't support rx-flip path (except old guests who don't
 		 * grok this feature flag).
 		 */
-		err = xenbus_printf(xbt, dev->nodename,
-				    "feature-rx-flip", "%d", 0);
+		err = xenbus_write(xbt, dev->nodename, "feature-rx-flip", "0");
 		if (err) {
 			message = "writing feature-rx-flip";
 			goto abort_transaction;
 		}
 
 		/* We support dynamic multicast-control. */
-		err = xenbus_printf(xbt, dev->nodename,
-				    "feature-multicast-control", "%d", 1);
+		err = xenbus_write(xbt, dev->nodename,
+				   "feature-multicast-control", "1");
 		if (err) {
 			message = "writing feature-multicast-control";
 			goto abort_transaction;
 		}
 
-		err = xenbus_printf(xbt, dev->nodename,
-				    "feature-dynamic-multicast-control",
-				    "%d", 1);
+		err = xenbus_write(xbt, dev->nodename,
+				   "feature-dynamic-multicast-control", "1");
 		if (err) {
 			message = "writing feature-dynamic-multicast-control";
 			goto abort_transaction;
@@ -368,9 +364,7 @@ static int netback_probe(struct xenbus_d
 	if (err)
 		pr_debug("Error writing multi-queue-max-queues\n");
 
-	err = xenbus_printf(XBT_NIL, dev->nodename,
-			    "feature-ctrl-ring",
-			    "%u", true);
+	err = xenbus_write(XBT_NIL, dev->nodename, "feature-ctrl-ring", "1");
 	if (err)
 		pr_debug("Error writing feature-ctrl-ring\n");
 




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-08 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07  7:58 [PATCH] xen-netback: prefer xenbus_write() over xenbus_printf() where possible Jan Beulich
2016-07-07  8:27 ` Paul Durrant
2016-07-08 16:13 ` Wei Liu
     [not found] ` <20160708161349.GB24399@citrix.com>
2016-07-08 16:15   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).