The function can't fail at this point. Remove the last outstanding pointless error check and turn the return type into 'void'. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 94e6e2b914..5341f5c1da 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1849,13 +1849,12 @@ virQEMUCapsNewBinary(const char *binary) } -static int +static void virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUData *dst, virQEMUCapsHostCPUData *src) { - if (src->info && - !(dst->info = qemuMonitorCPUModelInfoCopy(src->info))) - return -1; + if (src->info) + dst->info = qemuMonitorCPUModelInfoCopy(src->info); if (src->reported) dst->reported = virCPUDefCopy(src->reported); @@ -1865,8 +1864,6 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUData *dst, if (src->full) dst->full = virCPUDefCopy(src->full); - - return 0; } @@ -1968,8 +1965,7 @@ virQEMUCapsAccelCopy(virQEMUCapsAccel *dst, { virQEMUCapsAccelCopyMachineTypes(dst, src); - if (virQEMUCapsHostCPUDataCopy(&dst->hostCPU, &src->hostCPU) < 0) - return -1; + virQEMUCapsHostCPUDataCopy(&dst->hostCPU, &src->hostCPU); dst->cpuModels = qemuMonitorCPUDefsCopy(src->cpuModels); -- 2.39.2