]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu: Update style in virCPUBaseline
authorJiri Denemark <jdenemar@redhat.com>
Tue, 15 May 2018 09:04:10 +0000 (11:04 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 28 May 2018 13:59:10 +0000 (15:59 +0200)
To make it more consistent with the rest of the CPU driver code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
src/cpu/cpu.c

index 2c60d27b1713dad31f67e384c2d58c5172165427..b6c1695f2aec20317fcac3fb809000709b83428d 100644 (file)
@@ -515,14 +515,14 @@ virCPUBaseline(virArch arch,
             VIR_DEBUG("models[%zu]=%s", i, models->models[i].name);
     }
 
-    if (cpus == NULL && ncpus != 0) {
+    if (!cpus && ncpus != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("nonzero ncpus doesn't match with NULL cpus"));
         return NULL;
     }
 
     if (ncpus < 1) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s", _("No CPUs given"));
+        virReportError(VIR_ERR_INVALID_ARG, "%s", _("no CPUs given"));
         return NULL;
     }
 
@@ -542,10 +542,10 @@ virCPUBaseline(virArch arch,
     if (arch == VIR_ARCH_NONE)
         arch = cpus[0]->arch;
 
-    if ((driver = cpuGetSubDriver(arch)) == NULL)
+    if (!(driver = cpuGetSubDriver(arch)))
         return NULL;
 
-    if (driver->baseline == NULL) {
+    if (!driver->baseline) {
         virReportError(VIR_ERR_NO_SUPPORT,
                        _("cannot compute baseline CPU of %s architecture"),
                        virArchToString(arch));