[PATCH] cpu: Cleanup coding style in generic CPU driver

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/cpu/cpu_generic.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/cpu/cpu_generic.c b/src/cpu/cpu_generic.c
index 314d1e1..f115c40 100644
--- a/src/cpu/cpu_generic.c
+++ b/src/cpu/cpu_generic.c
@@ -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);
-- 
2.0.0

--
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]