On 12/13/23 11:56, Dmitry Frolov wrote: > Removed code is unreacheble, since the following functions always return 0: > virCPUx86DataAdd() > libxlCapsAddCPUID() > virCapabilitiesAddHostFeature() > libxl_get_physinfo() > virCapabilitiesSetNetPrefix() > libxlMakeDomainOSCaps() > libxlMakeDomainDeviceDiskCaps() > libxlMakeDomainDeviceGraphicsCaps() > libxlMakeDomainDeviceVideoCaps() > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Dmitry Frolov <frolov@xxxxxxxxx> > --- > src/libxl/libxl_capabilities.c | 34 ++++++++++++---------------------- > 1 file changed, 12 insertions(+), 22 deletions(-) > > diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c > index 177e8b988e..68908874fb 100644 > --- a/src/libxl/libxl_capabilities.c > +++ b/src/libxl/libxl_capabilities.c > @@ -64,12 +64,7 @@ libxlCapsAddCPUID(virCPUData *data, virCPUx86CPUID *cpuid, ssize_t ncaps) > item.type = VIR_CPU_X86_DATA_CPUID; > for (i = 0; i < ncaps; i++) { > item.data.cpuid = cpuid[i]; > - > - if (virCPUx86DataAdd(data, &item) < 0) { > - VIR_DEBUG("Failed to add CPUID(%x,%x)", > - cpuid[i].eax_in, cpuid[i].ecx_in); > - return -1; > - } > + virCPUx86DataAdd(data, &item) < 0); This will not compile. I am not against this change, but to make it even more complete, we should turn those functions into void. I mean, virCPUx86DataAdd() returns nothing else than 0? Perfect! Let's make it return nothing then. And it can be done in batches. From the list of functions the tool identified, each function can be 'fixed' in a separate patch. For instance, virCPUx86DataAdd() can be turned to void and all places where its retval is checked can be fixed too. This is going to be one patch. the second then fixes another function and places where it's called, and so on. Surely, libxl is not the only place where virCPUx86DataAdd() is called and where it has its retval checked. Michal _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx