From owner-svn-src-all@freebsd.org Thu Jan 28 16:58:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F13B5A71BE4; Thu, 28 Jan 2016 16:58:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5117181C; Thu, 28 Jan 2016 16:58:50 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SGwn0v041903; Thu, 28 Jan 2016 16:58:49 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SGwnLa041899; Thu, 28 Jan 2016 16:58:49 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201601281658.u0SGwnLa041899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 28 Jan 2016 16:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294998 - in head/sys: arm64/cavium dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 16:58:51 -0000 Author: zbb Date: Thu Jan 28 16:58:49 2016 New Revision: 294998 URL: https://svnweb.freebsd.org/changeset/base/294998 Log: Fix VNIC enumeration after r294993 and r294990 ofw_bus_get_node() must be tested against negative values since missing parent bus method will result in calling the default method which simply returns (-1): sys/dev/ofw/ofw_bus_if.m This was lost in the review process. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 16:52:02 2016 (r294997) +++ head/sys/arm64/cavium/thunder_pcie_fdt.c Thu Jan 28 16:58:49 2016 (r294998) @@ -276,7 +276,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t int i; /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_alloc_resource(bus, child, type, rid, start, end, count, flags)); } @@ -329,7 +329,7 @@ thunder_pcie_ofw_bus_rel_res(device_t bu { /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_release_resource(bus, child, type, rid, res)); } Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:52:02 2016 (r294997) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:58:49 2016 (r294998) @@ -244,7 +244,7 @@ bgx_fdt_find_node(struct bgx *bgx) } node = ofw_bus_get_node(root_pcib); - if (node == 0) { + if ((int)node <= 0) { device_printf(bgx->dev, "No parent FDT node for BGX\n"); goto out; }