Skip to content

Commit 6c27f99

Browse files
jbeulichdavem330
authored andcommitted
xen-netback: prefer xenbus_scanf() over xenbus_gather()
For single items being collected this should be preferred as being more typesafe (as the compiler can check format string and to-be-written-to variable match) and more efficient (requiring one less parameter to be passed). Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Paul Durrant <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1af9283 commit 6c27f99

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/xen-netback/xenbus.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -889,16 +889,16 @@ static int connect_ctrl_ring(struct backend_info *be)
889889
unsigned int evtchn;
890890
int err;
891891

892-
err = xenbus_gather(XBT_NIL, dev->otherend,
893-
"ctrl-ring-ref", "%u", &val, NULL);
894-
if (err)
892+
err = xenbus_scanf(XBT_NIL, dev->otherend,
893+
"ctrl-ring-ref", "%u", &val);
894+
if (err < 0)
895895
goto done; /* The frontend does not have a control ring */
896896

897897
ring_ref = val;
898898

899-
err = xenbus_gather(XBT_NIL, dev->otherend,
900-
"event-channel-ctrl", "%u", &val, NULL);
901-
if (err) {
899+
err = xenbus_scanf(XBT_NIL, dev->otherend,
900+
"event-channel-ctrl", "%u", &val);
901+
if (err < 0) {
902902
xenbus_dev_fatal(dev, err,
903903
"reading %s/event-channel-ctrl",
904904
dev->otherend);

0 commit comments

Comments
 (0)