]> xenbits.xensource.com Git - libvirt.git/commitdiff
sheepdog: Omit braces with a single-line body
authorHarry Wei <harryxiyou@gmail.com>
Mon, 22 Apr 2013 12:33:46 +0000 (20:33 +0800)
committerEric Blake <eblake@redhat.com>
Mon, 22 Apr 2013 14:33:35 +0000 (08:33 -0600)
libvirt/HACKING suggests omitting braces with a
single-line body; this patch fixes the coding style
problem for the Sheepdog storage backend driver.

Signed-off-by: Harry Wei <harryxiyou@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
src/storage/storage_backend_sheepdog.c

index 35a3a049404a12c209a0fef3e356c148bb74890b..15fa29c7e2214222b0bfcf9a8af01fd3d51d6488 100644 (file)
@@ -97,12 +97,10 @@ virStorageBackendSheepdogAddHostArg(virCommandPtr cmd,
     const char *address = "localhost";
     int port = 7000;
     if (pool->def->source.nhost > 0) {
-        if (pool->def->source.hosts[0].name != NULL) {
+        if (pool->def->source.hosts[0].name != NULL)
             address = pool->def->source.hosts[0].name;
-        }
-        if (pool->def->source.hosts[0].port) {
+        if (pool->def->source.hosts[0].port)
             port = pool->def->source.hosts[0].port;
-        }
     }
     virCommandAddArg(cmd, "-a");
     virCommandAddArgFormat(cmd, "%s", address);
@@ -210,11 +208,10 @@ virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
             continue;
 
         /* skip space */
-        if (p + 2 < next) {
+        if (p + 2 < next)
             p += 2;
-        } else {
+        else
             return -1;
-        }
 
         /* skip name */
         while (*p != '\0' && *p != ' ') {