[PATCH 06/11] maint: fix comma style issues: util

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

 



Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.

* src/util/vircommand.c: Consistently use commas.
* src/util/virlog.c: Likewise.
* src/util/virnetdevbandwidth.c: Likewise.
* src/util/virnetdevmacvlan.c: Likewise.
* src/util/virnetdevvportprofile.c: Likewise.
* src/util/virnetlink.c: Likewise.
* src/util/virpci.c: Likewise.
* src/util/virsysinfo.c: Likewise.
* src/util/virusb.c: Likewise.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 src/util/vircommand.c            | 4 ++--
 src/util/virlog.c                | 2 +-
 src/util/virnetdevbandwidth.c    | 4 ++--
 src/util/virnetdevmacvlan.c      | 2 +-
 src/util/virnetdevvportprofile.c | 2 +-
 src/util/virnetlink.c            | 2 +-
 src/util/virpci.c                | 3 ++-
 src/util/virsysinfo.c            | 2 +-
 src/util/virusb.c                | 2 +-
 9 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 8dcf9e7..a52a1ab 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -399,8 +399,8 @@ virExec(virCommandPtr cmd)
 {
     pid_t pid;
     int null = -1, fd, openmax;
-    int pipeout[2] = {-1,-1};
-    int pipeerr[2] = {-1,-1};
+    int pipeout[2] = {-1, -1};
+    int pipeerr[2] = {-1, -1};
     int childin = cmd->infd;
     int childout = -1;
     int childerr = -1;
diff --git a/src/util/virlog.c b/src/util/virlog.c
index 5b7e7b0..dfb4d69 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1183,7 +1183,7 @@ virLogOutputToJournald(virLogSource source,
     state.bufs = iov_bufs;
     state.bufs_end = iov_bufs + ARRAY_CARDINALITY(iov_bufs);

-    journalAddString(&state ,"MESSAGE", rawstr);
+    journalAddString(&state, "MESSAGE", rawstr);
     journalAddInt(&state, "PRIORITY", priority);
     journalAddString(&state, "LIBVIRT_SOURCE",
                      virLogSourceTypeToString(source));
diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index 317aa21..ed6a19d 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -167,7 +167,7 @@ virNetDevBandwidthSet(const char *ifname,
         }
         virCommandFree(cmd);
         cmd = virCommandNew(TC);
-        virCommandAddArgList(cmd,"class", "add", "dev", ifname, "parent",
+        virCommandAddArgList(cmd, "class", "add", "dev", ifname, "parent",
                              hierarchical_class ? "1:1" : "1:", "classid",
                              hierarchical_class ? "1:2" : "1:1", "htb",
                              "rate", average, NULL);
@@ -192,7 +192,7 @@ virNetDevBandwidthSet(const char *ifname,

         virCommandFree(cmd);
         cmd = virCommandNew(TC);
-        virCommandAddArgList(cmd,"filter", "add", "dev", ifname, "parent",
+        virCommandAddArgList(cmd, "filter", "add", "dev", ifname, "parent",
                              "1:0", "protocol", "ip", "handle", "1", "fw",
                              "flowid", "1", NULL);

diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 77cbd6d..e984bf2 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -332,7 +332,7 @@ int virNetDevMacVLanTapOpen(const char *ifname,

     if (fscanf(file, "%d", &ifindex) != 1) {
         virReportSystemError(errno,
-                             "%s",_("cannot determine macvtap's tap device "
+                             "%s", _("cannot determine macvtap's tap device "
                              "interface index"));
         VIR_FORCE_FCLOSE(file);
         return -1;
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index b84001a..c87837c 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -841,7 +841,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
     int rc;
     int src_pid = 0;
     uint32_t dst_pid = 0;
-    struct nlattr *tb[IFLA_MAX + 1] = { NULL , };
+    struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
     int repeats = STATUS_POLL_TIMEOUT_USEC / STATUS_POLL_INTERVL_USEC;
     uint16_t status = 0;
     bool is8021Qbg = (profileId == NULL);
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 901df6e..ba6c4b5 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -660,7 +660,7 @@ addentry:
         virMacAddrSet(&srv->handles[r].macaddr, macaddr);
     else
         virMacAddrSetRaw(&srv->handles[r].macaddr,
-                         (unsigned char[VIR_MAC_BUFLEN]){0,0,0,0,0,0});
+                         (unsigned char[VIR_MAC_BUFLEN]){0, 0, 0, 0, 0, 0});

     VIR_DEBUG("added client to loop slot: %d. with macaddr ptr=%p", r, macaddr);

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 8a3a492..8ec642f 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -374,7 +374,8 @@ virPCIDeviceWrite32(virPCIDevicePtr dev, int cfgfd, unsigned int pos, uint32_t v
     virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf));
 }

-typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr , virPCIDevicePtr , void *);
+typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr, virPCIDevicePtr,
+                                         void *);

 /* Iterate over available PCI devices calling @predicate
  * to compare each one to @dev.
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 1c8cae5..18f426d 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -756,7 +756,7 @@ virSysinfoParseMemory(const char *base, virSysinfoDefPtr ret)
             cur += 9;
             eol = strchr(cur, '\n');
             virSkipSpacesBackwards(cur, &eol);
-            if (eol && VIR_STRNDUP(memory->memory_locator,cur, eol - cur) < 0)
+            if (eol && VIR_STRNDUP(memory->memory_locator, cur, eol - cur) < 0)
                 return -1;
         }
         if ((cur = strstr(base, "Bank Locator: ")) != NULL) {
diff --git a/src/util/virusb.c b/src/util/virusb.c
index e901618..3c82200 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -216,7 +216,7 @@ virUSBDeviceFindByVendor(unsigned int vendor,
     virUSBDeviceListPtr list;
     int count;

-    if (!(list = virUSBDeviceSearch(vendor, product, 0 , 0,
+    if (!(list = virUSBDeviceSearch(vendor, product, 0, 0,
                                     vroot,
                                     USB_DEVICE_FIND_BY_VENDOR)))
         return -1;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]