Date: Sun, 20 Oct 2002 10:46:03 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Poul-Henning Kamp <phk@FreeBSD.ORG> Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: [src] cvs commit: src/sys/i386/pci pci_bus.c Message-ID: <200210201746.g9KHk34e033350@apollo.backplane.com> References: <20021020172212.C1EE937B493@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <dillon@backplane.com> :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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210201746.g9KHk34e033350>