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>
return -1;
}
- if (virBitmapSetBitExpand(levelsSeen, cache->level))
- return -1;
+ virBitmapSetBitExpand(levelsSeen, cache->level);
}
}
if ((ret = virBitmapNextClearBit(classIdMap, -1)) < 0)
ret = virBitmapSize(classIdMap);
- if (virBitmapSetBitExpand(classIdMap, ret) < 0)
- return -1;
+ virBitmapSetBitExpand(classIdMap, ret);
return ret;
}
*
* 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)
{
virBitmapExpand(bitmap, b);
bitmap->map[VIR_BITMAP_UNIT_OFFSET(b)] |= VIR_BITMAP_BIT(b);
- return 0;
}
if (neg) {
virBitmapClearBitExpand(bitmap, start);
} else {
- if (virBitmapSetBitExpand(bitmap, start) < 0)
- goto error;
+ virBitmapSetBitExpand(bitmap, start);
}
} else if (*cur == '-') {
if (neg)
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);
}
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);
/*
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;
goto cleanup;
}
- if (virBitmapSetBitExpand(cores_maps[sock], core) < 0)
- goto cleanup;
+ virBitmapSetBitExpand(cores_maps[sock], core);
if (!(siblings = virHostCPUCountThreadSiblings(cpu)))
goto cleanup;
if (virJSONValueGetNumberUlong(member, &value) < 0)
return -1;
- if (virBitmapSetBitExpand(bitmap, value) < 0)
- return -1;
+ virBitmapSetBitExpand(bitmap, value);
}
while ((pos = virBitmapNextSetBit(bitmap, pos)) > -1) {
if (typ < 0)
continue;
- if (virBitmapSetBitExpand(bitmap, typ) < 0)
- return bitmap;
+ virBitmapSetBitExpand(bitmap, typ);
}
return bitmap;
}
if (ret != 0 && ret != EXIT_AM_SKIP)
- ignore_value(virBitmapSetBitExpand(failedTests, testCounter));
+ virBitmapSetBitExpand(failedTests, testCounter);
g_unsetenv("VIR_TEST_MOCK_TESTNAME");
return ret;
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;
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")) {