render / rpms / libvirt

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