From nobody Fri Dec 19 22:05:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1738780285404864.4022172487762; Wed, 5 Feb 2025 10:31:25 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 207CF1D7D; Wed, 5 Feb 2025 13:31:24 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6305D1D1E; Wed, 5 Feb 2025 13:31:02 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7F80E1D1E; Wed, 5 Feb 2025 13:30:59 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id DEC2B1CE5 for ; Wed, 5 Feb 2025 13:30:58 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-392-kdX0ggLFPCqtDwEdrFLb5A-1; Wed, 05 Feb 2025 13:30:57 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5C92D1956094 for ; Wed, 5 Feb 2025 18:30:56 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6EAE1300018D for ; Wed, 5 Feb 2025 18:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738780258; h=from:from: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; bh=5uwOYbKVZ0jZCnboaSKlEXVv+xxIw/IdeNWYUPXjHIs=; b=jJUSsrVA+n7nge9DMF8qlsgoBHhcg0rqxBN9k5Ebizm61ramTfh4xxqke6/LtOB0BYYIgw XqOA2f7nV3/11hWLuU4swz0KtEB9KW48VXRcphhDsiH3CHgWB2ip0PicYimi0ppZIOiaLk hmDqXKBVtXcPbBKckAper7cm9dv7upU= X-MC-Unique: kdX0ggLFPCqtDwEdrFLb5A-1 X-Mimecast-MFC-AGG-ID: kdX0ggLFPCqtDwEdrFLb5A From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH pushed] node_device_udev: Fix build failure in ccw device code Date: Wed, 5 Feb 2025 19:30:53 +0100 Message-ID: <15cd4ec8329b77cd8719236339e127bdb7521bd9.1738780137.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Dlmk5cl7lL7nKP-2Sy6Q339IqjaNnaJfccM9yhLo0mY_1738780256 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2BWDWRF3GDZ55EUHHLRHBSHMMEYVRG5W X-Message-ID-Hash: 2BWDWRF3GDZ55EUHHLRHBSHMMEYVRG5W X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738780289141019000 Content-Type: text/plain; charset="utf-8" clang complains: ../../../libvirt/src/node_device/node_device_udev.c:1408:82: error: result = of comparison of unsigned enum expression < 0 is always false [-Werror,-Wta= utological-unsigned-enum-zero-compare] 1408 | if ((data->ccwgroup_dev.type =3D virNodeDevCCWGroupCapTypeFromS= tring(devtype)) < 0) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~ ^ ~ 1 error generated. Fix it by adding a temporary int variable to facilitate the check before assigning to the unsigned enum value. Fixes: 985cb9c32a6 Signed-off-by: Peter Krempa --- src/node_device/node_device_udev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 082f9d5cf0..94e8626aee 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1398,6 +1398,7 @@ udevProcessCCWGroup(struct udev_device *device, { const char *devtype =3D udev_device_get_devtype(device); virNodeDevCapData *data =3D &def->caps->data; + int tmp; data->ccwgroup_dev.address =3D virCCWDeviceAddressFromString(udev_devi= ce_get_sysname(device)); @@ -1405,9 +1406,11 @@ udevProcessCCWGroup(struct udev_device *device, udevGenerateDeviceName(device, def, NULL); - if ((data->ccwgroup_dev.type =3D virNodeDevCCWGroupCapTypeFromString(d= evtype)) < 0) + if ((tmp =3D virNodeDevCCWGroupCapTypeFromString(devtype)) < 0) return -1; + data->ccwgroup_dev.type =3D tmp; + switch (data->ccwgroup_dev.type) { case VIR_NODE_DEV_CAP_CCWGROUP_QETH_GENERIC: case VIR_NODE_DEV_CAP_CCWGROUP_QETH_LAYER2: --=20 2.48.1