]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
cpu: Cleanup coding style in generic CPU driver
authorJiri Denemark <jdenemar@redhat.com>
Wed, 28 May 2014 12:49:45 +0000 (14:49 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 25 Jun 2014 22:43:49 +0000 (00:43 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/cpu/cpu_generic.c

index 314d1e14b8fcedca37c50ba7d6660b306ecace73..f115c40d3e981fdba5a72ada1171fad56ae02009 100644 (file)
@@ -64,8 +64,8 @@ genericCompare(virCPUDefPtr host,
     size_t i;
     unsigned int reqfeatures;
 
-    if (((cpu->arch != VIR_ARCH_NONE) &&
-         (host->arch != cpu->arch)) ||
+    if ((cpu->arch != VIR_ARCH_NONE &&
+         host->arch != cpu->arch) ||
         STRNEQ(host->model, cpu->model))
         return VIR_CPU_COMPARE_INCOMPATIBLE;
 
@@ -83,13 +83,10 @@ genericCompare(virCPUDefPtr host,
                 goto cleanup;
             }
             reqfeatures++;
-        }
-        else {
-            if (cpu->type == VIR_CPU_TYPE_HOST ||
-                cpu->features[i].policy == VIR_CPU_FEATURE_REQUIRE) {
-                ret = VIR_CPU_COMPARE_INCOMPATIBLE;
-                goto cleanup;
-            }
+        } else if (cpu->type == VIR_CPU_TYPE_HOST ||
+                   cpu->features[i].policy == VIR_CPU_FEATURE_REQUIRE) {
+            ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+            goto cleanup;
         }
     }
 
@@ -99,9 +96,9 @@ genericCompare(virCPUDefPtr host,
             ret = VIR_CPU_COMPARE_INCOMPATIBLE;
         else
             ret = VIR_CPU_COMPARE_SUPERSET;
-    }
-    else
+    } else {
         ret = VIR_CPU_COMPARE_IDENTICAL;
+    }
 
  cleanup:
     virHashFree(hash);