xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org, netdev@vger.kernel.org
Subject: [PATCH] xen-netback: prefer xenbus_write() over xenbus_printf() where possible
Date: Thu, 07 Jul 2016 01:58:18 -0600	[thread overview]
Message-ID: <577E27BA02000078000FBEC3@prv-mh.provo.novell.com> (raw)

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

             reply	other threads:[~2016-07-07  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07  7:58 Jan Beulich [this message]
2016-07-07  8:27 ` [PATCH] xen-netback: prefer xenbus_write() over xenbus_printf() where possible Paul Durrant
2016-07-08 16:13 ` Wei Liu
     [not found] ` <20160708161349.GB24399@citrix.com>
2016-07-08 16:15   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577E27BA02000078000FBEC3@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).