mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 07:33:50 +00:00
virBitmapSetBitExpand: Remove return value
The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7d48c3d2d6
commit
f3af9e36fb
@ -1149,8 +1149,7 @@ virDomainNumaDefValidate(const virDomainNuma *def)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virBitmapSetBitExpand(levelsSeen, cache->level))
|
||||
return -1;
|
||||
virBitmapSetBitExpand(levelsSeen, cache->level);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4966,8 +4966,7 @@ networkNextClassID(virNetworkObj *obj)
|
||||
if ((ret = virBitmapNextClearBit(classIdMap, -1)) < 0)
|
||||
ret = virBitmapSize(classIdMap);
|
||||
|
||||
if (virBitmapSetBitExpand(classIdMap, ret) < 0)
|
||||
return -1;
|
||||
virBitmapSetBitExpand(classIdMap, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -153,10 +153,8 @@ virBitmapExpand(virBitmap *map,
|
||||
*
|
||||
* Set bit position @b in @bitmap. Expands the bitmap as necessary so that @b is
|
||||
* included in the map.
|
||||
*
|
||||
* Returns 0 on if bit is successfully set, -1 on error.
|
||||
*/
|
||||
int
|
||||
void
|
||||
virBitmapSetBitExpand(virBitmap *bitmap,
|
||||
size_t b)
|
||||
{
|
||||
@ -164,7 +162,6 @@ virBitmapSetBitExpand(virBitmap *bitmap,
|
||||
virBitmapExpand(bitmap, b);
|
||||
|
||||
bitmap->map[VIR_BITMAP_UNIT_OFFSET(b)] |= VIR_BITMAP_BIT(b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -571,8 +568,7 @@ virBitmapParseUnlimited(const char *str)
|
||||
if (neg) {
|
||||
virBitmapClearBitExpand(bitmap, start);
|
||||
} else {
|
||||
if (virBitmapSetBitExpand(bitmap, start) < 0)
|
||||
goto error;
|
||||
virBitmapSetBitExpand(bitmap, start);
|
||||
}
|
||||
} else if (*cur == '-') {
|
||||
if (neg)
|
||||
@ -588,10 +584,8 @@ virBitmapParseUnlimited(const char *str)
|
||||
|
||||
cur = tmp;
|
||||
|
||||
for (i = start; i <= last; i++) {
|
||||
if (virBitmapSetBitExpand(bitmap, i) < 0)
|
||||
goto error;
|
||||
}
|
||||
for (i = start; i <= last; i++)
|
||||
virBitmapSetBitExpand(bitmap, i);
|
||||
|
||||
virSkipSpaces(&cur);
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ void virBitmapFree(virBitmap *bitmap);
|
||||
int virBitmapSetBit(virBitmap *bitmap, size_t b)
|
||||
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
int virBitmapSetBitExpand(virBitmap *bitmap, size_t b)
|
||||
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
|
||||
void virBitmapSetBitExpand(virBitmap *bitmap, size_t b)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -336,8 +336,7 @@ virHostCPUParseNode(const char *node,
|
||||
if (virHostCPUGetSocket(cpu, &sock) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virBitmapSetBitExpand(sockets_map, sock) < 0)
|
||||
goto cleanup;
|
||||
virBitmapSetBitExpand(sockets_map, sock);
|
||||
|
||||
if (sock > sock_max)
|
||||
sock_max = sock;
|
||||
@ -396,8 +395,7 @@ virHostCPUParseNode(const char *node,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virBitmapSetBitExpand(cores_maps[sock], core) < 0)
|
||||
goto cleanup;
|
||||
virBitmapSetBitExpand(cores_maps[sock], core);
|
||||
|
||||
if (!(siblings = virHostCPUCountThreadSiblings(cpu)))
|
||||
goto cleanup;
|
||||
|
@ -70,8 +70,7 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key,
|
||||
if (virJSONValueGetNumberUlong(member, &value) < 0)
|
||||
return -1;
|
||||
|
||||
if (virBitmapSetBitExpand(bitmap, value) < 0)
|
||||
return -1;
|
||||
virBitmapSetBitExpand(bitmap, value);
|
||||
}
|
||||
|
||||
while ((pos = virBitmapNextSetBit(bitmap, pos)) > -1) {
|
||||
|
@ -251,8 +251,7 @@ virTPMExecGetCaps(virCommand *cmd,
|
||||
if (typ < 0)
|
||||
continue;
|
||||
|
||||
if (virBitmapSetBitExpand(bitmap, typ) < 0)
|
||||
return bitmap;
|
||||
virBitmapSetBitExpand(bitmap, typ);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
|
@ -173,7 +173,7 @@ virTestRun(const char *title,
|
||||
}
|
||||
|
||||
if (ret != 0 && ret != EXIT_AM_SKIP)
|
||||
ignore_value(virBitmapSetBitExpand(failedTests, testCounter));
|
||||
virBitmapSetBitExpand(failedTests, testCounter);
|
||||
|
||||
g_unsetenv("VIR_TEST_MOCK_TESTNAME");
|
||||
return ret;
|
||||
|
@ -558,8 +558,7 @@ test12a(const void *opaque G_GNUC_UNUSED)
|
||||
if (checkBitmap(map, "", 0) < 0)
|
||||
return -1;
|
||||
|
||||
if (virBitmapSetBitExpand(map, 128) < 0)
|
||||
return -1;
|
||||
virBitmapSetBitExpand(map, 128);
|
||||
|
||||
if (checkBitmap(map, "128", 129) < 0)
|
||||
return -1;
|
||||
@ -692,8 +691,8 @@ test16(const void *opaque G_GNUC_UNUSED)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ignore_value(virBitmapSetBitExpand(map, 2));
|
||||
ignore_value(virBitmapSetBitExpand(map, 11));
|
||||
virBitmapSetBitExpand(map, 2);
|
||||
virBitmapSetBitExpand(map, 11);
|
||||
|
||||
if (!(res_set = virBitmapToString(map)) ||
|
||||
STRNEQ_NULLABLE(res_set, "804")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user