From owner-cvs-all Sun Oct 20 10:46: 5 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE69737B401; Sun, 20 Oct 2002 10:46:03 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CBEE43E77; Sun, 20 Oct 2002 10:46:03 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g9KHk3PQ033351; Sun, 20 Oct 2002 10:46:03 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g9KHk34e033350; Sun, 20 Oct 2002 10:46:03 -0700 (PDT) (envelope-from dillon) Date: Sun, 20 Oct 2002 10:46:03 -0700 (PDT) From: Matthew Dillon Message-Id: <200210201746.g9KHk34e033350@apollo.backplane.com> To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: [src] cvs commit: src/sys/i386/pci pci_bus.c References: <20021020172212.C1EE937B493@hub.freebsd.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Not so. The -1 is promoted to unsigned for the comparison. The code may be ugly and need a cast to br proper, but the condition can in fact return true here. I recommend you back this out or that you audit the nexus_pcib_read_config() code to ensure that it cannot return the equivalent of -1 unsigned. I suspect that it can in fact return -1. -Matt Matthew Dillon :phk 2002/10/20 10:21:44 PDT : : Modified files: : sys/i386/pci pci_bus.c : Log: : "id" is never going to be -1 when it is unsigned. : : Spotted by: FlexeLint : : Revision Changes Path : 1.94 +0 -2 src/sys/i386/pci/pci_bus.c : : :Index: src/sys/i386/pci/pci_bus.c :diff -u src/sys/i386/pci/pci_bus.c:1.93 src/sys/i386/pci/pci_bus.c:1.94 :--- src/sys/i386/pci/pci_bus.c:1.93 Wed Oct 16 11:38:35 2002 :+++ src/sys/i386/pci/pci_bus.c Sun Oct 20 10:21:43 2002 :@@ -23,7 +23,7 @@ : * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF : * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. : * :- * $FreeBSD: /repoman/r/ncvs/src/sys/i386/pci/pci_bus.c,v 1.93 2002/10/16 18:38:35 jhb Exp $ :+ * $FreeBSD: /repoman/r/ncvs/src/sys/i386/pci/pci_bus.c,v 1.94 2002/10/20 17:21:43 phk Exp $ : * : */ : :@@ -344,8 +344,6 @@ : : id = nexus_pcib_read_config(0, bus, slot, func, : PCIR_DEVVENDOR, 4); :- if (id == -1) :- continue; : class = nexus_pcib_read_config(0, bus, slot, func, : PCIR_CLASS, 1); : subclass = nexus_pcib_read_config(0, bus, slot, func, : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message