From owner-svn-src-head@freebsd.org Tue Jun 12 19:50:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 457431017482; Tue, 12 Jun 2018 19:50:34 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7CBF768AE; Tue, 12 Jun 2018 19:50:33 +0000 (UTC) (envelope-from leitao@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8E3572E9; Tue, 12 Jun 2018 19:50:33 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CJoXqi091698; Tue, 12 Jun 2018 19:50:33 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CJoXn5091697; Tue, 12 Jun 2018 19:50:33 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201806121950.w5CJoXn5091697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Tue, 12 Jun 2018 19:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335013 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 335013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 19:50:34 -0000 Author: leitao Date: Tue Jun 12 19:50:33 2018 New Revision: 335013 URL: https://svnweb.freebsd.org/changeset/base/335013 Log: powerpc64/powernv: Avoid type promotion There is a type promotion that transform count = -1 into a unsigned int causing the default TCE SEG SIZE not being returned on a Boston POWER9 machine. This machine does not have the 'ibm,supported-tce-sizes' entries, thus, count is set to -1, and the function continue to execute instead of returning. Reviewed by: jhibbits, wma Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D15763 Modified: head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:36:32 2018 (r335012) +++ head/sys/powerpc/powernv/opal_pci.c Tue Jun 12 19:50:33 2018 (r335013) @@ -221,7 +221,7 @@ max_tce_size(device_t dev) count = OF_getencprop(node, "ibm,supported-tce-sizes", sizes, sizeof(sizes)); - if (count < sizeof(cell_t)) + if (count < (int) sizeof(cell_t)) return OPAL_PCI_TCE_DEFAULT_SEG_SIZE; count /= sizeof(cell_t);