Re: [PATCH 1/3] libxl: Break down an if() in libxlCapsInitNuma()

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

 



On 5/12/21 7:23 AM, Michal Privoznik wrote:
There's an if-else statement in libxlCapsInitNuma() that can
really be just two standalone if()-s. Writing it as such helps
with code readability.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
  src/libxl/libxl_capabilities.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx>

Regards,
Jim


diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index ea4f370a6d..a64a9266c4 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -260,13 +260,13 @@ libxlCapsInitNuma(libxl_ctx *ctx, virCaps *caps)
          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                         _("libxl_get_numainfo failed"));
          goto cleanup;
-    } else {
-        cpu_topo = libxl_get_cpu_topology(ctx, &nr_cpus);
-        if (cpu_topo == NULL || nr_cpus == 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("libxl_get_cpu_topology failed"));
-            goto cleanup;
-        }
+    }
+
+    cpu_topo = libxl_get_cpu_topology(ctx, &nr_cpus);
+    if (cpu_topo == NULL || nr_cpus == 0) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("libxl_get_cpu_topology failed"));
+        goto cleanup;
      }
cpus = g_new0(virCapsHostNUMACellCPU *, nr_nodes);





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

  Powered by Linux