svn commit: r335013 - head/sys/powerpc/powernv
Breno Leitao
leitao at FreeBSD.org
Tue Jun 12 19:50:34 UTC 2018
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);
More information about the svn-src-all
mailing list