virCPUx86DataAddItem() always returns 0. Signed-off-by: Dmitry Frolov <frolov@xxxxxxxxx> --- src/cpu/cpu_x86.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 8d0e3947ce..f32770b8a3 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -531,7 +531,7 @@ x86DataCopy(virCPUx86Data *dst, const virCPUx86Data *src) } -static int +static void virCPUx86DataAddItem(virCPUx86Data *data, const virCPUx86DataItem *item) { @@ -547,8 +547,6 @@ virCPUx86DataAddItem(virCPUx86Data *data, sizeof(virCPUx86DataItem), virCPUx86DataSorter, NULL); } - - return 0; } @@ -561,10 +559,8 @@ x86DataAdd(virCPUx86Data *data1, virCPUx86DataIteratorInit(&iter, data2); while ((item = virCPUx86DataNext(&iter))) { - if (virCPUx86DataAddItem(data1, item) < 0) - return -1; + virCPUx86DataAddItem(data1, item); } - return 0; } @@ -819,8 +815,9 @@ x86DataAddSignature(virCPUx86Data *data, uint32_t signature) { virCPUx86DataItem leaf1 = CPUID(.eax_in = 0x1, .eax = signature); + virCPUx86DataAddItem(data, &leaf1); - return virCPUx86DataAddItem(data, &leaf1); + return 0; } @@ -1125,8 +1122,7 @@ x86ParseDataItemList(virCPUx86Data *cpudata, } } - if (virCPUx86DataAddItem(cpudata, &item) < 0) - return -1; + virCPUx86DataAddItem(cpudata, &item); ++i; node = xmlNextElementSibling(node); @@ -2911,9 +2907,8 @@ virCPUx86Baseline(virCPUDef **cpus, return NULL; } - if (vendor && - virCPUx86DataAddItem(&base_model->data, &vendor->data) < 0) - return NULL; + if (vendor) + virCPUx86DataAddItem(&base_model->data, &vendor->data); if (x86Decode(cpu, &base_model->data, models, (const char **) modelNames, migratable) < 0) @@ -3172,9 +3167,8 @@ virCPUx86Translate(virCPUDef *cpu, if (!(model = x86ModelFromCPU(cpu, map, -1))) return -1; - if (model->vendor && - virCPUx86DataAddItem(&model->data, &model->vendor->data) < 0) - return -1; + if (model->vendor) + virCPUx86DataAddItem(&model->data, &model->vendor->data); if (model->signatures && model->signatures->count > 0) { virCPUx86Signature *sig = &model->signatures->items[0]; @@ -3302,7 +3296,8 @@ int virCPUx86DataAdd(virCPUData *cpuData, const virCPUx86DataItem *item) { - return virCPUx86DataAddItem(&cpuData->data.x86, item); + virCPUx86DataAddItem(&cpuData->data.x86, item); + return 0; } -- 2.34.1 _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx