[libvirt] [PATCH 18/22] cpu: Update style in virCPUBaseline

Jiri Denemark posted 22 patches 7 years, 7 months ago
[libvirt] [PATCH 18/22] cpu: Update style in virCPUBaseline
Posted by Jiri Denemark 7 years, 7 months ago
To make it more consistent with the rest of the CPU driver code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 2c60d27b17..b6c1695f2a 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -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));
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 18/22] cpu: Update style in virCPUBaseline
Posted by Ján Tomko 7 years, 6 months ago
On Wed, May 16, 2018 at 10:39:37AM +0200, Jiri Denemark wrote:
>To make it more consistent with the rest of the CPU driver code.
>
>Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
>---
> src/cpu/cpu.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 18/22] cpu: Update style in virCPUBaseline
Posted by Collin Walling 7 years, 6 months ago
On 05/16/2018 04:39 AM, Jiri Denemark wrote:
> To make it more consistent with the rest of the CPU driver code.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/cpu/cpu.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Reviewed-by: Collin Walling <walling@linux.ibm.com>

-- 
Respectfully,
- Collin Walling

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list