From nobody Mon Feb 9 13:58:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639052473; cv=none; d=zohomail.com; s=zohoarc; b=P+y0CC548b+Dg0THIRLkWwqQW7atXBtxFqvJ9fbRhBLHPec1HiZ/Ln5vG6OCrNv4dHeqJ8dIm2PRMjWdS17hqZwpemEf77NK5XqEta9JpF74UzOOz1UfQ9z+eBz/fesQeAcbTNBy4uOnxlnGJFhXf3HfF6p5kl4ecL1RrFkLvYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639052473; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yRlkUo/rP2wF3xs9X/dCBpBtuTYwo/aje2X19NkeV00=; b=EKg2M3dbSBhmBHhtRnu3NqMLbdLe5yFltBDVXvn+Fy1kcApcLpghOJApfMkPHDyC5t9jRTBkIwiVQAA1C/dmg/HXyZRCmn5W8TIVde7D6SFCT2YO4U9jvs8cgvhHkuU1U4hCi7TLjlrHfm6WP6v56fIfti93ce+nUkCDj4FdI8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639052473611471.7965995378818; Thu, 9 Dec 2021 04:21:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-ckuL8W-SMVe0ZWGGueVu4w-1; Thu, 09 Dec 2021 07:21:09 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A178801AC5; Thu, 9 Dec 2021 12:21:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9101B1ABE5; Thu, 9 Dec 2021 12:21:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 633124A706; Thu, 9 Dec 2021 12:21:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B9CL1St014975 for ; Thu, 9 Dec 2021 07:21:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id D78635ED37; Thu, 9 Dec 2021 12:21:01 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D0915E26C for ; Thu, 9 Dec 2021 12:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639052472; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yRlkUo/rP2wF3xs9X/dCBpBtuTYwo/aje2X19NkeV00=; b=EqLppLwViQtMSAtTip3EfSF+cjs2ZQFR+GPC7v3mVHxpCdNklOxxqmpqxqfaK5rVeh2lYL TEsHE7TGA3OxBfem62Gn22ENUOPkSIfzjsyZS9LOMG3XF4PrrlIYwPzJyREo6DA49uQEUm P9FqqUGi1+YQZJqaTZuuwogaiqiFjyc= X-MC-Unique: ckuL8W-SMVe0ZWGGueVu4w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 23/36] virBitmapClearBitExpand: Remove return value Date: Thu, 9 Dec 2021 13:18:28 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639052475589100001 Content-Type: text/plain; charset="utf-8" The function can't fail at this point. Remove the return value. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- 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 th= at * @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)] &=3D ~VIR_BITMAP_BIT(b); } - - return 0; } @@ -573,8 +569,7 @@ virBitmapParseUnlimited(const char *str) if (*cur =3D=3D ',' || *cur =3D=3D 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; --=20 2.31.1