[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen-netback: prefer xenbus_write() over xenbus_printf() where possible



... as being the simpler variant.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.