render / rpms / libvirt

Forked from rpms/libvirt 11 months ago
Clone
Pablo Greco 40546a
From ed7c9cb6444ec9344ebb253eac417703c5371c2d Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <ed7c9cb6444ec9344ebb253eac417703c5371c2d@dist-git>
Pablo Greco 40546a
From: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Date: Fri, 21 Jun 2019 09:25:31 +0200
Pablo Greco 40546a
Subject: [PATCH] cpu_x86: Simplify x86DataAdd
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
The while loop just copied half of virCPUx86DataAddItem.
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
(cherry picked from commit 0fdc0ad84c7ea27480f6f4edb82389d414584ada)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Message-Id: <8ffc18c0ee7c61e5e1ce1af023ee7e6c62726f5a.1561068591.git.jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/cpu/cpu_x86.c | 15 ++++-----------
Pablo Greco 40546a
 1 file changed, 4 insertions(+), 11 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
Pablo Greco 40546a
index 9c0f39e76d..0582be63e2 100644
Pablo Greco 40546a
--- a/src/cpu/cpu_x86.c
Pablo Greco 40546a
+++ b/src/cpu/cpu_x86.c
Pablo Greco 40546a
@@ -403,18 +403,11 @@ x86DataAdd(virCPUx86Data *data1,
Pablo Greco 40546a
            const virCPUx86Data *data2)
Pablo Greco 40546a
 {
Pablo Greco 40546a
     virCPUx86DataIterator iter = virCPUx86DataIteratorInit(data2);
Pablo Greco 40546a
-    virCPUx86DataItemPtr item1;
Pablo Greco 40546a
-    virCPUx86DataItemPtr item2;
Pablo Greco 40546a
+    virCPUx86DataItemPtr item;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    while ((item2 = virCPUx86DataNext(&iter))) {
Pablo Greco 40546a
-        item1 = virCPUx86DataGet(data1, item2);
Pablo Greco 40546a
-
Pablo Greco 40546a
-        if (item1) {
Pablo Greco 40546a
-            x86cpuidSetBits(&item1->cpuid, &item2->cpuid);
Pablo Greco 40546a
-        } else {
Pablo Greco 40546a
-            if (virCPUx86DataAddItem(data1, item2) < 0)
Pablo Greco 40546a
-                return -1;
Pablo Greco 40546a
-        }
Pablo Greco 40546a
+    while ((item = virCPUx86DataNext(&iter))) {
Pablo Greco 40546a
+        if (virCPUx86DataAddItem(data1, item) < 0)
Pablo Greco 40546a
+            return -1;
Pablo Greco 40546a
     }
Pablo Greco 40546a
 
Pablo Greco 40546a
     return 0;
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a