]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove unnecessary curly brackets in src/util/
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Nov 2014 14:28:18 +0000 (15:28 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 14 Nov 2014 16:13:35 +0000 (17:13 +0100)
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
25 files changed:
src/util/virauth.c
src/util/virbitmap.c
src/util/virbuffer.c
src/util/vircommand.c
src/util/virconf.c
src/util/virdbus.c
src/util/virdnsmasq.c
src/util/vireventpoll.c
src/util/virfile.c
src/util/virfirewall.c
src/util/viriscsi.c
src/util/virlockspace.c
src/util/virlog.c
src/util/virnetdev.c
src/util/virnetdevbridge.c
src/util/virnetdevmacvlan.c
src/util/virnetdevtap.c
src/util/virpci.c
src/util/virsexpr.c
src/util/virstorageencryption.c
src/util/virstoragefile.c
src/util/virsysinfo.c
src/util/virthreadpool.c
src/util/virutil.c
src/util/virxml.c

index f82e54651f6fbbb506df89f51a199da9aa707626..adb093e101efc2abe8589f6e7ceaae074fa7a32e 100644 (file)
@@ -172,15 +172,13 @@ virAuthGetUsernamePath(const char *path,
             return NULL;
         }
     } else {
-        if (virAsprintf(&prompt, _("Enter username for %s"), hostname) < 0) {
+        if (virAsprintf(&prompt, _("Enter username for %s"), hostname) < 0)
             return NULL;
-        }
     }
 
     for (ncred = 0; ncred < auth->ncredtype; ncred++) {
-        if (auth->credtype[ncred] != VIR_CRED_AUTHNAME) {
+        if (auth->credtype[ncred] != VIR_CRED_AUTHNAME)
             continue;
-        }
 
         cred.type = VIR_CRED_AUTHNAME;
         cred.prompt = prompt;
@@ -189,9 +187,8 @@ virAuthGetUsernamePath(const char *path,
         cred.result = NULL;
         cred.resultlen = 0;
 
-        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
+        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0)
             VIR_FREE(cred.result);
-        }
 
         break;
     }
@@ -261,9 +258,8 @@ virAuthGetPasswordPath(const char *path,
         cred.result = NULL;
         cred.resultlen = 0;
 
-        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
+        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0)
             VIR_FREE(cred.result);
-        }
 
         break;
     }
index 04a2388049d2f4d71b921a7b0987d38c31597a5d..05c50e4e8e6f97063b36eb0b239448c9629830a9 100644 (file)
@@ -640,9 +640,8 @@ virBitmapNextSetBit(virBitmapPtr bitmap, ssize_t pos)
 
     bits = bitmap->map[nl] & ~((1UL << nb) - 1);
 
-    while (bits == 0 && ++nl < bitmap->map_len) {
+    while (bits == 0 && ++nl < bitmap->map_len)
         bits = bitmap->map[nl];
-    }
 
     if (bits == 0)
         return -1;
@@ -726,9 +725,8 @@ virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos)
 
     bits = ~bitmap->map[nl] & ~((1UL << nb) - 1);
 
-    while (bits == 0 && ++nl < bitmap->map_len) {
+    while (bits == 0 && ++nl < bitmap->map_len)
         bits = ~bitmap->map[nl];
-    }
 
     if (nl == bitmap->map_len - 1) {
         /* Ensure tail bits are ignored.  */
index 52ffa0814793c87506b1a064d120de79000f5162..16a81e7df5c767e1eebe92ca8f5e855e5101363d 100644 (file)
@@ -368,9 +368,8 @@ virBufferVasprintf(virBufferPtr buf, const char *format, va_list argptr)
         buf->content[buf->use] = 0;
 
         grow_size = (count + 1 > 1000) ? count + 1 : 1000;
-        if (virBufferGrow(buf, grow_size) < 0) {
+        if (virBufferGrow(buf, grow_size) < 0)
             return;
-        }
 
         size = buf->size - buf->use;
         if ((count = vsnprintf(&buf->content[buf->use],
index cbe94f8d3bff398531c87513b111976d2c8eab13..6527d85e58ca7b751c15ac9e6658baef0245562d 100644 (file)
@@ -558,9 +558,8 @@ virExec(virCommandPtr cmd)
 
     pid = virFork();
 
-    if (pid < 0) {
+    if (pid < 0)
         goto cleanup;
-    }
 
     if (pid) { /* parent */
         VIR_FORCE_CLOSE(null);
@@ -3021,9 +3020,8 @@ virCommandRunNul(virCommandPtr cmd,
         v[i] = NULL;
 
     virCommandSetOutputFD(cmd, &fd);
-    if (virCommandRunAsync(cmd, NULL) < 0) {
+    if (virCommandRunAsync(cmd, NULL) < 0)
         goto cleanup;
-    }
 
     if ((fp = VIR_FDOPEN(fd, "r")) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -3050,9 +3048,8 @@ virCommandRunNul(virCommandPtr cmd,
             if (func(n_tok, v, data) < 0)
                 goto cleanup;
             n_tok = 0;
-            for (i = 0; i < n_columns; i++) {
+            for (i = 0; i < n_columns; i++)
                 VIR_FREE(v[i]);
-            }
         }
     }
 
index e221fb554e4abd5bc9209389e9488a33e5ef28be..0a17eff3865dd607fd18ba80083d531c19670070 100644 (file)
@@ -502,9 +502,8 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
             }
             NEXT;
             SKIP_BLANKS_AND_EOL;
-            if (CUR == ']') {
+            if (CUR == ']')
                 break;
-            }
             tmp = virConfParseValue(ctxt);
             if (tmp == NULL) {
                 virConfFreeList(lst);
@@ -529,9 +528,8 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
                          _("numbers not allowed in VMX format"));
             return NULL;
         }
-        if (virConfParseLong(ctxt, &l) < 0) {
+        if (virConfParseLong(ctxt, &l) < 0)
             return NULL;
-        }
         type = VIR_CONF_LONG;
     } else {
         virConfError(ctxt, VIR_ERR_CONF_SYNTAX, _("expecting a value"));
@@ -654,9 +652,8 @@ virConfParseStatement(virConfParserCtxtPtr ctxt)
     char *comm = NULL;
 
     SKIP_BLANKS_AND_EOL;
-    if (CUR == '#') {
+    if (CUR == '#')
         return virConfParseComment(ctxt);
-    }
     name = virConfParseName(ctxt);
     if (name == NULL)
         return -1;
@@ -768,9 +765,8 @@ virConfReadFile(const char *filename, unsigned int flags)
         return NULL;
     }
 
-    if ((len = virFileReadAll(filename, MAX_CONFIG_FILE_SIZE, &content)) < 0) {
+    if ((len = virFileReadAll(filename, MAX_CONFIG_FILE_SIZE, &content)) < 0)
         return NULL;
-    }
 
     conf = virConfParse(filename, content, len, flags);
 
@@ -888,9 +884,8 @@ virConfSetValue(virConfPtr conf,
 
     cur = conf->entries;
     while (cur != NULL) {
-        if ((cur->name != NULL) && (STREQ(cur->name, setting))) {
+        if ((cur->name != NULL) && (STREQ(cur->name, setting)))
             break;
-        }
         prev = cur;
         cur = cur->next;
     }
index 7c24cbf7bc53754a4d524fd2f4063b70557ee9b2..8abb2479219b87588a861465303930c9ef69bbe3 100644 (file)
@@ -546,9 +546,8 @@ static void virDBusTypeStackFree(virDBusTypeStack **stack,
     /* The iter in the first level of the stack is the
      * root iter which must not be freed
      */
-    for (i = 1; i < *nstack; i++) {
+    for (i = 1; i < *nstack; i++)
         VIR_FREE((*stack)[i].iter);
-    }
     VIR_FREE(*stack);
 }
 
index d2c4aa99a295ceffea6c1a59b7c40906c6f5f4ed..97652c0aa602e3781a498dbc96c376d90360cccd 100644 (file)
@@ -726,9 +726,8 @@ dnsmasqCapsRefreshInternal(dnsmasqCapsPtr caps, bool force)
                              caps->binaryPath);
         return -1;
     }
-    if (!force && caps->mtime == sb.st_mtime) {
+    if (!force && caps->mtime == sb.st_mtime)
         return 0;
-    }
     caps->mtime = sb.st_mtime;
 
     /* Make sure the binary we are about to try exec'ing exists.
index 13f40dcb1a0c7d4892323f024700504f3e90b571..ffda206b8d5ecad70056fa4632a3cc0fce312b16 100644 (file)
@@ -221,9 +221,8 @@ int virEventPollAddTimeout(int frequency,
     unsigned long long now;
     int ret;
 
-    if (virTimeMillisNow(&now) < 0) {
+    if (virTimeMillisNow(&now) < 0)
         return -1;
-    }
 
     virMutexLock(&eventLoop.lock);
     if (eventLoop.timeoutsCount == eventLoop.timeoutsAlloc) {
@@ -270,9 +269,8 @@ void virEventPollUpdateTimeout(int timer, int frequency)
         return;
     }
 
-    if (virTimeMillisNow(&now) < 0) {
+    if (virTimeMillisNow(&now) < 0)
         return;
-    }
 
     virMutexLock(&eventLoop.lock);
     for (i = 0; i < eventLoop.timeoutsCount; i++) {
@@ -643,9 +641,8 @@ int virEventPollRunOnce(void)
     ret = poll(fds, nfds, timeout);
     if (ret < 0) {
         EVENT_DEBUG("Poll got error event %d", errno);
-        if (errno == EINTR || errno == EAGAIN) {
+        if (errno == EINTR || errno == EAGAIN)
             goto retry;
-        }
         virReportSystemError(errno, "%s",
                              _("Unable to poll on file handles"));
         goto error_unlocked;
index 64f0e5bb8637189ff447f98473a8c8dbdd21d03c..b4d762fe355808891a35f7df08225fd3e8218b94 100644 (file)
@@ -1180,9 +1180,8 @@ virBuildPathInternal(char **path, ...)
     va_end(ap);
 
     *path = virBufferContentAndReset(&buf);
-    if (*path == NULL) {
+    if (*path == NULL)
         ret = -1;
-    }
 
     return ret;
 }
@@ -2047,9 +2046,8 @@ virFileOpenForked(const char *path, int openflags, mode_t mode,
         /* XXX This makes assumptions about errno being < 255, which is
          * not true on Hurd.  */
         VIR_FORCE_CLOSE(pair[1]);
-        if (ret < 0) {
+        if (ret < 0)
             VIR_FORCE_CLOSE(fd);
-        }
         ret = -ret;
         if ((ret & 0xff) != ret) {
             VIR_WARN("unable to pass desired return value %d", ret);
index c83fdc628f71ba790bd1eb10f6600317ad12fc5f..e82fdc3b03cd69f97ea11dbb47ec4d2a0a8a69ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * virfirewall.c: integration with firewalls
  *
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2013, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -382,9 +382,8 @@ virFirewallAddRuleFullV(virFirewallPtr firewall,
         break;
     }
 
-    while ((str = va_arg(args, char *)) != NULL) {
+    while ((str = va_arg(args, char *)) != NULL)
         ADD_ARG(rule, str);
-    }
 
     if (group->addingRollback) {
         if (VIR_APPEND_ELEMENT_COPY(group->rollback,
@@ -590,9 +589,8 @@ void virFirewallRuleAddArgList(virFirewallPtr firewall,
 
     va_start(list, rule);
 
-    while ((str = va_arg(list, char *)) != NULL) {
+    while ((str = va_arg(list, char *)) != NULL)
         ADD_ARG(rule, str);
-    }
 
     va_end(list);
 
index 5e29be9319f369d8c8935dc2e1578f6ffc520b14..ef8fb59508388e3223c0968ccbc77ea4a4bbdcbd 100644 (file)
@@ -157,9 +157,8 @@ virStorageBackendIQNFound(const char *initiatoriqn,
         *newline = '\0';
 
         iqn = strrchr(line, ',');
-        if (iqn == NULL) {
+        if (iqn == NULL)
             continue;
-        }
         iqn++;
 
         if (STREQ(iqn, initiatoriqn)) {
@@ -185,9 +184,8 @@ virStorageBackendIQNFound(const char *initiatoriqn,
         ret = IQN_ERROR;
 
  out:
-    if (ret == IQN_MISSING) {
+    if (ret == IQN_MISSING)
         VIR_DEBUG("Could not find interface with IQN '%s'", iqn);
-    }
 
     VIR_FREE(line);
     VIR_FORCE_FCLOSE(fp);
@@ -451,9 +449,8 @@ virISCSIScanTargets(const char *portal,
         *ntargetsret = list.ntargets;
         *targetsret = list.targets;
     } else {
-        for (i = 0; i < list.ntargets; i++) {
+        for (i = 0; i < list.ntargets; i++)
             VIR_FREE(list.targets[i]);
-        }
         VIR_FREE(list.targets);
     }
 
index 8969ab0947a29d16c25a90637c6536c111465f86..2366a742466389273b60d8cd853432868b3fb178 100644 (file)
@@ -679,9 +679,8 @@ int virLockSpaceReleaseResource(virLockSpacePtr lockspace,
     }
 
     for (i = 0; i < res->nOwners; i++) {
-        if (res->owners[i] == owner) {
+        if (res->owners[i] == owner)
             break;
-        }
     }
 
     if (i == res->nOwners) {
@@ -723,9 +722,8 @@ virLockSpaceRemoveResourcesForOwner(const void *payload,
     VIR_DEBUG("res %s owner %lld", res->name, (unsigned long long)data->owner);
 
     for (i = 0; i < res->nOwners; i++) {
-        if (res->owners[i] == data->owner) {
+        if (res->owners[i] == data->owner)
             break;
-        }
     }
 
     if (i == res->nOwners)
index 286ad9e791633b5daef009281713124c5870cc2b..14eb12979dbbaf1815e951d5995e62f0665d0d4a 100644 (file)
@@ -578,9 +578,8 @@ virLogVMessage(virLogSourcePtr source,
     /*
      * serialize the error message, add level and timestamp
      */
-    if (virVasprintfQuiet(&str, fmt, vargs) < 0) {
+    if (virVasprintfQuiet(&str, fmt, vargs) < 0)
         goto cleanup;
-    }
 
     ret = virLogFormatString(&msg, linenr, funcname, priority, str);
     if (ret < 0)
index 3831009d87295def2c7cf1fa08cd6541b611afb5..35149784bd41b05b1ff7806089baad1c313f645a 100644 (file)
@@ -1185,9 +1185,8 @@ virNetDevGetVirtualFunctions(const char *pfname,
             goto cleanup;
         }
 
-        if (virPCIGetNetName(pci_sysfs_device_link, &((*vfname)[i])) < 0) {
+        if (virPCIGetNetName(pci_sysfs_device_link, &((*vfname)[i])) < 0)
             VIR_INFO("VF does not have an interface name");
-        }
     }
 
     ret = 0;
@@ -1758,9 +1757,8 @@ virNetDevRestoreVfConfig(const char *pflinkdev, int vf,
                     stateDir, pflinkdev, vf) < 0)
         return rc;
 
-    if (virFileReadAll(path, 128, &fileData) < 0) {
+    if (virFileReadAll(path, 128, &fileData) < 0)
         goto cleanup;
-    }
 
     if ((vlan = strchr(fileData, '\n'))) {
         char *endptr;
index d388358c881f740e265d883f6306eb6e42fb6d6d..15434de45ca5ec5c455752fd2c3816b5d482b2ca 100644 (file)
@@ -265,9 +265,8 @@ int virNetDevBridgeCreate(const char *brname)
         goto cleanup;
     }
 
-    if (virNetDevSetName(ifr.ifr_name, brname) == -1) {
+    if (virNetDevSetName(ifr.ifr_name, brname) == -1)
         goto cleanup;
-    }
 
     ret = 0;
  cleanup:
index c83341c0d7806040ce4d73eca3ed059e2f63c5b7..89e221dd526a9db3f078f27c351dae6541efb124 100644 (file)
@@ -682,9 +682,8 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
         }
     }
 
-    if (!indicate) {
+    if (!indicate)
         return;
-    }
 
     VIR_INFO("Re-send 802.1qbg associate request:");
     VIR_INFO("  if: %s", calld->cr_ifname);
@@ -851,9 +850,8 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
             return -1;
 
         if (ret) {
-            if (STRPREFIX(tgifname, prefix)) {
+            if (STRPREFIX(tgifname, prefix))
                 goto create_name;
-            }
             virReportSystemError(EEXIST,
                                  _("Unable to create macvlan device %s"), tgifname);
             return -1;
@@ -983,9 +981,8 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
     int ret = 0;
     int vf = -1;
 
-    if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU) {
+    if (mode == VIR_NETDEV_MACVLAN_MODE_PASSTHRU)
         ignore_value(virNetDevRestoreMacAddress(linkdev, stateDir));
-    }
 
     if (ifname) {
         if (virNetDevVPortProfileDisassociate(ifname,
index 3674f9be711349171a9380a4639f7efbf9625c35..85688ab1e36c7e6a31ada358f59d1baa7aa47eb0 100644 (file)
@@ -108,9 +108,8 @@ virNetDevTapGetRealDeviceName(char *ifname ATTRIBUTE_UNUSED)
     while (virDirRead(dirp, &dp, "/dev") > 0) {
         if (STRPREFIX(dp->d_name, "tap")) {
             struct ifreq ifr;
-            if (virAsprintf(&devpath, "/dev/%s", dp->d_name) < 0) {
+            if (virAsprintf(&devpath, "/dev/%s", dp->d_name) < 0)
                 goto cleanup;
-            }
             if ((fd = open(devpath, O_RDWR)) < 0) {
                 if (errno == EBUSY) {
                     VIR_FREE(devpath);
@@ -444,9 +443,8 @@ int virNetDevTapCreate(char **ifname,
         VIR_FREE(dev_path);
     }
 
-    if (virNetDevSetName(ifr.ifr_name, *ifname) == -1) {
+    if (virNetDevSetName(ifr.ifr_name, *ifname) == -1)
         goto cleanup;
-    }
 
 
     ret = 0;
index d8e465faebf2bb968bca246f1482c7c80a590c82..f60d0fa6402c9a09c23912a661da247f38158c87 100644 (file)
@@ -1127,9 +1127,8 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
         goto reprobe;
 
     /* Xen's pciback.ko wants you to use remove_slot on the specific device */
-    if (virPCIDriverFile(&path, driver, "remove_slot") < 0) {
+    if (virPCIDriverFile(&path, driver, "remove_slot") < 0)
         goto cleanup;
-    }
 
     if (virFileExists(path) && virFileWriteStr(path, dev->name, 0) < 0) {
         virReportSystemError(errno,
@@ -1214,9 +1213,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
      * is triggered for such a device, it will also be immediately
      * bound by the stub.
      */
-    if (virPCIDriverFile(&path, stubDriverName, "new_id") < 0) {
+    if (virPCIDriverFile(&path, stubDriverName, "new_id") < 0)
         goto cleanup;
-    }
 
     if (virFileWriteStr(path, dev->id, 0) < 0) {
         virReportSystemError(errno,
@@ -1242,9 +1240,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
      */
     if (!virFileLinkPointsTo(driverLink, stubDriverPath)) {
         /* Xen's pciback.ko wants you to use new_slot first */
-        if (virPCIDriverFile(&path, stubDriverName, "new_slot") < 0) {
+        if (virPCIDriverFile(&path, stubDriverName, "new_slot") < 0)
             goto remove_id;
-        }
 
         if (virFileExists(path) && virFileWriteStr(path, dev->name, 0) < 0) {
             virReportSystemError(errno,
@@ -1255,9 +1252,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
         }
         dev->remove_slot = true;
 
-        if (virPCIDriverFile(&path, stubDriverName, "bind") < 0) {
+        if (virPCIDriverFile(&path, stubDriverName, "bind") < 0)
             goto remove_id;
-        }
 
         if (virFileWriteStr(path, dev->name, 0) < 0) {
             virReportSystemError(errno,
@@ -1505,9 +1501,8 @@ virPCIDeviceReadID(virPCIDevicePtr dev, const char *id_name)
     char *path = NULL;
     char *id_str;
 
-    if (virPCIFile(&path, dev->name, id_name) < 0) {
+    if (virPCIFile(&path, dev->name, id_name) < 0)
         return NULL;
-    }
 
     /* ID string is '0xNNNN\n' ... i.e. 7 bytes */
     if (virFileReadAll(path, 7, &id_str) < 0) {
index f8a0ccdb433805e32e565b483f88aa51f0030899..885c382a5f3fb257a44350c97877556d3c18ba51 100644 (file)
@@ -65,9 +65,8 @@ sexpr_free(struct sexpr *sexpr)
 {
     int serrno = errno;
 
-    if (sexpr == NULL) {
+    if (sexpr == NULL)
         return;
-    }
 
     switch (sexpr->kind) {
         case SEXPR_CONS:
@@ -163,9 +162,8 @@ append(struct sexpr *lst, const struct sexpr *value)
     if (nil == NULL)
         return -1;
 
-    while (lst->kind != SEXPR_NIL) {
+    while (lst->kind != SEXPR_NIL)
         lst = lst->u.s.cdr;
-    }
 
     lst->kind = SEXPR_CONS;
     lst->u.s.car = (struct sexpr *) value;
@@ -300,9 +298,8 @@ _string2sexpr(const char *buffer, size_t * end)
             ptr = trim(ptr + tmp_len);
         }
 
-        if (*ptr == ')') {
+        if (*ptr == ')')
             ptr++;
-        }
     } else {
         const char *start;
 
@@ -394,13 +391,11 @@ sexpr_lookup_key(const struct sexpr *sexpr, const char *node)
     ptr = buffer;
     token = strsep(&ptr, "/");
 
-    if (sexpr->kind != SEXPR_CONS || sexpr->u.s.car->kind != SEXPR_VALUE) {
+    if (sexpr->kind != SEXPR_CONS || sexpr->u.s.car->kind != SEXPR_VALUE)
         goto cleanup;
-    }
 
-    if (STRNEQ(sexpr->u.s.car->u.value, token)) {
+    if (STRNEQ(sexpr->u.s.car->u.value, token))
         goto cleanup;
-    }
 
     for (token = strsep(&ptr, "/"); token; token = strsep(&ptr, "/")) {
         const struct sexpr *i;
@@ -419,14 +414,12 @@ sexpr_lookup_key(const struct sexpr *sexpr, const char *node)
             }
         }
 
-        if (i->kind == SEXPR_NIL) {
+        if (i->kind == SEXPR_NIL)
             break;
-        }
     }
 
-    if (token != NULL) {
+    if (token != NULL)
         goto cleanup;
-    }
 
     result = (struct sexpr *) sexpr;
 
@@ -538,9 +531,8 @@ sexpr_fmt_node(const struct sexpr *sexpr, const char *fmt, ...)
     result = virVasprintf(&node, fmt, ap);
     va_end(ap);
 
-    if (result < 0) {
+    if (result < 0)
         return NULL;
-    }
 
     value = sexpr_node(sexpr, node);
 
index b5fed580eb3937b0732ddadeab2932774a6edba8..ec4a8cbccf3525426c57a08f57416ebfb6daec7c 100644 (file)
@@ -193,9 +193,8 @@ virStorageEncryptionParseXML(xmlXPathContextPtr ctxt)
     ret->format = format;
 
     n = virXPathNodeSet("./secret", ctxt, &nodes);
-    if (n < 0) {
+    if (n < 0)
         goto cleanup;
-    }
     if (n != 0 && VIR_ALLOC_N(ret->secrets, n) < 0)
         goto cleanup;
     ret->nsecrets = n;
index 8e9d11560ac46e2751bb736e949bb38120512296..aa97f75c0ccc34ba9a4fd2f46c444fef62543422 100644 (file)
@@ -1204,9 +1204,8 @@ int virStorageFileGetLVMKey(const char *path,
         char *tmp = *key;
 
         /* Find first non-space character */
-        while (*tmp && c_isspace(*tmp)) {
+        while (*tmp && c_isspace(*tmp))
             tmp++;
-        }
         /* Kill leading spaces */
         if (tmp != *key)
             memmove(*key, tmp, strlen(tmp)+1);
@@ -1919,9 +1918,8 @@ virStorageSourceInitChainElement(virStorageSourcePtr newelem,
 {
     int ret = -1;
 
-    if (force) {
+    if (force)
         virStorageSourceSeclabelsClear(newelem);
-    }
 
     if (!newelem->seclabels &&
         virStorageSourceSeclabelsCopy(newelem, old) < 0)
index 1bb6392da3561702df32108947fe4789c51d50a6..d644dbc8afd8e89c095ff12f99dcc66bbf8d63ce 100644 (file)
@@ -179,9 +179,8 @@ virSysinfoParseProcessor(const char *base, virSysinfoDefPtr ret)
         eol = strchr(base, '\n');
         cur = strchr(base, ':') + 1;
 
-        if (VIR_EXPAND_N(ret->processor, ret->nprocessor, 1) < 0) {
+        if (VIR_EXPAND_N(ret->processor, ret->nprocessor, 1) < 0)
             return -1;
-        }
         processor = &ret->processor[ret->nprocessor - 1];
 
         virSkipSpaces(&cur);
index 4c46f28a9965d56ff3c3f5677b76e3cc5272e57b..98d212473b7cff0f45a535a642acb4ba42415a29 100644 (file)
@@ -122,9 +122,8 @@ static void virThreadPoolWorker(void *opaque)
         if (job == pool->jobList.firstPrio) {
             virThreadPoolJobPtr tmp = job->next;
             while (tmp) {
-                if (tmp->priority) {
+                if (tmp->priority)
                     break;
-                }
                 tmp = tmp->next;
             }
             pool->jobList.firstPrio = tmp;
index c178515908defc0505250aef6a609f50d9abea5a..88c8baf46d53ea1972e8fbf1ac99de4ab2cbc68d 100644 (file)
@@ -603,9 +603,8 @@ char *virIndexToDiskName(int idx, const char *prefix)
     strcpy(name, prefix);
     name[offset + i] = '\0';
 
-    for (i = i - 1, ctr = idx; ctr >= 0; --i, ctr = ctr / 26 - 1) {
+    for (i = i - 1, ctr = idx; ctr >= 0; --i, ctr = ctr / 26 - 1)
         name[offset + i] = 'a' + (ctr % 26);
-    }
 
     return name;
 }
@@ -1539,9 +1538,8 @@ virValidateWWN(const char *wwn)
     size_t i;
     const char *p = wwn;
 
-    if (STRPREFIX(wwn, "0x")) {
+    if (STRPREFIX(wwn, "0x"))
         p += 2;
-    }
 
     for (i = 0; p[i]; i++) {
         if (!c_isxdigit(p[i]))
@@ -2563,9 +2561,8 @@ virGetListenFDs(void)
 
         VIR_DEBUG("Disabling inheritance of passed FD %d", fd);
 
-        if (virSetInherit(fd, false) < 0) {
+        if (virSetInherit(fd, false) < 0)
             VIR_WARN("Couldn't disable inheritance of passed FD %d", fd);
-        }
     }
 
     return nfds;
index 27ecf14a249f435a3428d20059783804c0eef560..7f591fb4f1a892c69c495d60c1dcda59daff7629 100644 (file)
@@ -185,9 +185,8 @@ virXPathLongBase(const char *xpath,
     } else if ((obj != NULL) && (obj->type == XPATH_NUMBER) &&
                (!(isnan(obj->floatval)))) {
         *value = (long) obj->floatval;
-        if (*value != obj->floatval) {
+        if (*value != obj->floatval)
             ret = -2;
-        }
     } else {
         ret = -1;
     }
@@ -291,9 +290,8 @@ virXPathULongBase(const char *xpath,
     } else if ((obj != NULL) && (obj->type == XPATH_NUMBER) &&
                (!(isnan(obj->floatval)))) {
         *value = (unsigned long) obj->floatval;
-        if (*value != obj->floatval) {
+        if (*value != obj->floatval)
             ret = -2;
-        }
     } else {
         ret = -1;
     }
@@ -408,9 +406,8 @@ virXPathULongLong(const char *xpath,
     } else if ((obj != NULL) && (obj->type == XPATH_NUMBER) &&
                (!(isnan(obj->floatval)))) {
         *value = (unsigned long long) obj->floatval;
-        if (*value != obj->floatval) {
+        if (*value != obj->floatval)
             ret = -2;
-        }
     } else {
         ret = -1;
     }
@@ -455,9 +452,8 @@ virXPathLongLong(const char *xpath,
     } else if ((obj != NULL) && (obj->type == XPATH_NUMBER) &&
                (!(isnan(obj->floatval)))) {
         *value = (long long) obj->floatval;
-        if (*value != obj->floatval) {
+        if (*value != obj->floatval)
             ret = -2;
-        }
     } else {
         ret = -1;
     }
@@ -655,9 +651,8 @@ catchXMLError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
     base = ctxt->input->base;
 
     /* skip backwards over any end-of-lines */
-    while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) {
+    while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r')))
         cur--;
-    }
 
     /* search backwards for beginning-of-line (to max buff size) */
     while ((cur > base) && (*(cur) != '\n') && (*(cur) != '\r'))
@@ -669,9 +664,8 @@ catchXMLError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
 
     /* search forward for end-of-line (to max buff size) */
     /* copy selected text to our buffer */
-    while ((*cur != 0) && (*(cur) != '\n') && (*(cur) != '\r')) {
+    while ((*cur != 0) && (*(cur) != '\n') && (*(cur) != '\r'))
         virBufferAddChar(&buf, *cur++);
-    }
 
     /* create blank line with problem pointer */
     contextstr = virBufferContentAndReset(&buf);