Date: Tue, 12 Jun 2018 19:50:33 +0000 (UTC) From: Breno Leitao <leitao@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335013 - head/sys/powerpc/powernv Message-ID: <201806121950.w5CJoXn5091697@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806121950.w5CJoXn5091697>