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