The function can't fail at this point. Remove the return value.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virbitmap.c | 9 ++-------
src/util/virbitmap.h | 4 ++--
tests/virbitmaptest.c | 3 +--
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index c067b1f738..ecc4b96a57 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -196,10 +196,8 @@ virBitmapClearBit(virBitmap *bitmap,
*
* Clear 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 cleared, -1 on error.
*/
-int
+void
virBitmapClearBitExpand(virBitmap *bitmap,
size_t b)
{
@@ -208,8 +206,6 @@ virBitmapClearBitExpand(virBitmap *bitmap,
} else {
bitmap->map[VIR_BITMAP_UNIT_OFFSET(b)] &= ~VIR_BITMAP_BIT(b);
}
-
- return 0;
}
@@ -573,8 +569,7 @@ virBitmapParseUnlimited(const char *str)
if (*cur == ',' || *cur == 0) {
if (neg) {
- if (virBitmapClearBitExpand(bitmap, start) < 0)
- goto error;
+ virBitmapClearBitExpand(bitmap, start);
} else {
if (virBitmapSetBitExpand(bitmap, start) < 0)
goto error;
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 23242b44ff..08ada97aa1 100644
--- a/src/util/virbitmap.h
+++ b/src/util/virbitmap.h
@@ -54,8 +54,8 @@ int virBitmapSetBitExpand(virBitmap *bitmap, size_t b)
int virBitmapClearBit(virBitmap *bitmap, size_t b)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
-int virBitmapClearBitExpand(virBitmap *bitmap, size_t b)
- ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
+void virBitmapClearBitExpand(virBitmap *bitmap, size_t b)
+ ATTRIBUTE_NONNULL(1);
/*
* Get bit @b in @bitmap. Returns false if b is out of range.
diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index 4c525679f6..f16df4d2b2 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -564,8 +564,7 @@ test12a(const void *opaque G_GNUC_UNUSED)
if (checkBitmap(map, "128", 129) < 0)
return -1;
- if (virBitmapClearBitExpand(map, 150) < 0)
- return -1;
+ virBitmapClearBitExpand(map, 150);
if (checkBitmap(map, "128", 151) < 0)
return -1;
--
2.31.1