]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virBitmapClearBitExpand: Remove return value
authorPeter Krempa <pkrempa@redhat.com>
Mon, 6 Dec 2021 14:55:46 +0000 (15:55 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 10 Dec 2021 15:36:25 +0000 (16:36 +0100)
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>
src/util/virbitmap.c
src/util/virbitmap.h
tests/virbitmaptest.c

index c067b1f7389222454b9f9eaaa89fc34b50f2c1e8..ecc4b96a571166b70b861d1754b79e6c6059927f 100644 (file)
@@ -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;
index 23242b44ff5262b51f4abfbabebf0717d8ac1fb9..08ada97aa17a16220921463ad8f958deb1ec7f78 100644 (file)
@@ -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.
index 4c525679f6aa3c2a0c85107197ad241cfe4bb7a3..f16df4d2b2cf9e5b489b2f3cb3424c60e52627fd 100644 (file)
@@ -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;