From nobody Mon May 6 07:21:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1573475004; cv=none; d=zoho.com; s=zohoarc; b=ccunRi8uktG9MnngG211Tzob8BABaG02KrlARDDdSy4TG9IjeYWOX0m3IW3nSMMXbMH2aarTE4iIdzV+sGMHN4kPPfSlz+/HuScRJAfo7J6opPr8e9004Hum2aB0RatoJNjzOAkVISUMKG61J3yrFSyZCXltFJbOLu+fBEJgdRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573475004; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xvPnc1Asut8t1mUG6P5pIG5L0QsBhobE35D5CMtwcu4=; b=f5M16tnF3LVdY9MdnN2S+CJPW72TOMcFc95h1PSr0chFdZn38d7JAGeKqZi2uClF8JeEDTHIDuSF9O/5mSsfHT7O10mkuOdPF3yvEK6EisBaH6NjV0mZT+1D+v0Y3c6H7Law5c9CrOhs1JNcUnabgTbyLv0lkefm6ryZrMWZxRE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 157347500466211.461248967739607; Mon, 11 Nov 2019 04:23:24 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-4GQtJuaKPeK4BAZQ92j4OQ-1; Mon, 11 Nov 2019 07:23:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51245805DA0; Mon, 11 Nov 2019 12:23:13 +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 E5C7918340; Mon, 11 Nov 2019 12:23:12 +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 1FD3318089CD; Mon, 11 Nov 2019 12:23:11 +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 xABCN9SE011982 for ; Mon, 11 Nov 2019 07:23:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8FC3817AD4; Mon, 11 Nov 2019 12:23:09 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id E811918340; Mon, 11 Nov 2019 12:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573475003; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xvPnc1Asut8t1mUG6P5pIG5L0QsBhobE35D5CMtwcu4=; b=dWkW3wNJ9GGuW3qiYAImQu0jfBMHNGmnT0go1JBRSHrmilrCYNTuitTGBs56l++g8IYTg8 qgj6d8r46yKMeUNgg4S9liGUt1N1Ja7U3Nd7cQDBpEPk03ds0+iIGl7zW/QuidBlrguIo4 V+9+Dbra+yeNgW6MNolkStA20S+qAYI= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 11 Nov 2019 13:23:05 +0100 Message-Id: <7af6b4e7cb24eeb46d1cfa17edc26a5454140222.1573474910.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com Subject: [libvirt] [PATCH] util: pci: Remove always-false condition 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.14 X-MC-Unique: 4GQtJuaKPeK4BAZQ92j4OQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit d19c21429fd modified the condition so that it checks whether the value is more than 0xFFFFFFFF. Since addr->domain is an unsigned int, it will never be more than that. Remove the whole check src/util/virpci.c:1291:22: error: result of comparison 'unsigned int' > 429= 4967295 is always false [-Werror,-Wtautological-type-limit-compare] if (addr->domain > 0xFFFFFFFF) { ~~~~~~~~~~~~ ^ ~~~~~~~~~~ Signed-off-by: Peter Krempa --- This was caught by new clang: $ clang -v clang version 9.0.0 (Fedora 9.0.0-1.fc31) This "fix" is the naive approach which assumes the original patch was correct. src/util/virpci.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index f9e39e79d8..cd560d683b 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1288,14 +1288,6 @@ bool virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, bool report) { - if (addr->domain > 0xFFFFFFFF) { - if (report) - virReportError(VIR_ERR_XML_ERROR, - _("Invalid PCI address domain=3D'0x%x', " - "must be <=3D 0xFFFF"), - addr->domain); - return false; - } if (addr->bus > 0xFF) { if (report) virReportError(VIR_ERR_XML_ERROR, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list