mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
virHostCPUCountThreadSiblings: Refactor cleanup
Use automatic memory freeing for the temporary bitmap and remove the pointless 'cleanup' section. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4aa3d8fffa
commit
19228b6016
@ -271,17 +271,12 @@ virHostCPUGetSiblingsList(unsigned int cpu)
|
||||
static unsigned long
|
||||
virHostCPUCountThreadSiblings(unsigned int cpu)
|
||||
{
|
||||
virBitmap *siblings_map;
|
||||
unsigned long ret = 0;
|
||||
g_autoptr(virBitmap) siblings_map = NULL;
|
||||
|
||||
if (!(siblings_map = virHostCPUGetSiblingsList(cpu)))
|
||||
goto cleanup;
|
||||
return 0;
|
||||
|
||||
ret = virBitmapCountBits(siblings_map);
|
||||
|
||||
cleanup:
|
||||
virBitmapFree(siblings_map);
|
||||
return ret;
|
||||
return virBitmapCountBits(siblings_map);
|
||||
}
|
||||
|
||||
/* parses a node entry, returning number of processors in the node and
|
||||
|
Loading…
Reference in New Issue
Block a user