* [PATCH] xen-netfront: prefer xenbus_write() over xenbus_printf() where possible
@ 2016-07-07 8:00 Jan Beulich
2016-07-07 11:12 ` David Vrabel
[not found] ` <577E3918.5030303@citrix.com>
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2016-07-07 8:00 UTC (permalink / raw)
To: david.vrabel, boris.ostrovsky, Juergen Gross; +Cc: xen-devel, netdev
... 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(-)
--- 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;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen-netfront: prefer xenbus_write() over xenbus_printf() where possible
2016-07-07 8:00 [PATCH] xen-netfront: prefer xenbus_write() over xenbus_printf() where possible Jan Beulich
@ 2016-07-07 11:12 ` David Vrabel
[not found] ` <577E3918.5030303@citrix.com>
1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2016-07-07 11:12 UTC (permalink / raw)
To: Jan Beulich, david.vrabel, boris.ostrovsky, Juergen Gross
Cc: xen-devel, netdev
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
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen-netfront: prefer xenbus_write() over xenbus_printf() where possible
[not found] ` <577E3918.5030303@citrix.com>
@ 2016-07-07 12:05 ` Jan Beulich
0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2016-07-07 12:05 UTC (permalink / raw)
To: boris.ostrovsky; +Cc: Juergen Gross, xen-devel, david.vrabel, netdev
>>> 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
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-07 12:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07 8:00 [PATCH] xen-netfront: prefer xenbus_write() over xenbus_printf() where possible Jan Beulich
2016-07-07 11:12 ` David Vrabel
[not found] ` <577E3918.5030303@citrix.com>
2016-07-07 12:05 ` Jan Beulich
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).