From nobody Mon Feb 9 04:45:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1638543860; cv=none; d=zohomail.com; s=zohoarc; b=QJ9JU6OTh/6y7VOZ5Esi1jlHKxRz2KNYTd862tS6K9vcoMi0vqOGvHp6lKDlMiFuQ9dZfhnWcGx3YsO1LvnUmEEKXn/9wRLmbasMfeUoIgAi+2sh5nqwNhqcn/eJ06icWz/znrj7vr0qplW0ITIbSeYX3IMQRsUpMV6wm8XCvRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638543860; 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=Q925W1vXz0D8Po7oDXK0n8CSdt8ZjJO4iZvM+wsAkIc=; b=GfsNl4hHq9D/0UTUshyu9dfgfh6Vry2Pbq/PUrLmyRY7ZcpKuxDn1UGMYQ6ekcjz0f6fg6zhDvQKjrcjpeZX2T11ZL7Hdp8Si3noEKDlcUsDsZZkRudlR5aDTuEzw23VGgP2pN0ZC/6mvtMLWyRa0CmK+AWfwW0TKrQrbNzK+T8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1638543860624265.73813605258056; Fri, 3 Dec 2021 07:04:20 -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-180-BJgrmfNaPz6awULwkQD08Q-1; Fri, 03 Dec 2021 10:04:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 96BFD835E32; Fri, 3 Dec 2021 15:04:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77AAB10016FE; Fri, 3 Dec 2021 15:04:05 +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 215181802E34; Fri, 3 Dec 2021 15:04:05 +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 1B3F43Ml031193 for ; Fri, 3 Dec 2021 10:04:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 454F75ED2F; Fri, 3 Dec 2021 15:04:03 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C4815DAA5 for ; Fri, 3 Dec 2021 15:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638543859; 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=Q925W1vXz0D8Po7oDXK0n8CSdt8ZjJO4iZvM+wsAkIc=; b=OdItGEJM9kw2LfA82QzJ21hfwDzc9JJGWRM5y2HP6oPviorTsp3PhX8Kioea0d41JgrI1u OWvjpl+1ZgJgmgX3lvlvjjnnGQoXXrH+j5OVKZvetrQ1cOhTzp/8NGqrk4SHjVzDi8RjKl o9502CMgfovsEhXV4EL49jbSIq4aDxw= X-MC-Unique: BJgrmfNaPz6awULwkQD08Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/17] VIR_REQUIRE_FLAG_(GOTO|RET): Add parens around arguments in expansion Date: Fri, 3 Dec 2021 16:01:51 +0100 Message-Id: <9dbe0a2f0afe58c652a6dc634cdf35357be14ae8.1638543496.git.pkrempa@redhat.com> 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.84 on 10.5.11.22 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: 1638543862111100001 Content-Type: text/plain; charset="utf-8" Make the macro useful also for cases when one of multiple flags is required. Signed-off-by: Peter Krempa --- src/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal.h b/src/internal.h index 2e404cd705..b6e4332542 100644 --- a/src/internal.h +++ b/src/internal.h @@ -374,7 +374,7 @@ */ #define VIR_REQUIRE_FLAG_RET(FLAG1, FLAG2, RET) \ do { \ - if ((flags & FLAG1) && !(flags & FLAG2)) { \ + if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \ virReportInvalidArg(ctl, \ _("Flag '%s' is required by flag '%s'"), \ #FLAG2, #FLAG1); \ @@ -396,7 +396,7 @@ */ #define VIR_REQUIRE_FLAG_GOTO(FLAG1, FLAG2, LABEL) \ do { \ - if ((flags & FLAG1) && !(flags & FLAG2)) { \ + if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \ virReportInvalidArg(ctl, \ _("Flag '%s' is required by flag '%s'"), \ #FLAG2, #FLAG1); \ --=20 2.31.1