svn commit: r355980 - head/sys/contrib/ncsw/Peripherals/QM
Gleb Popov
arrowd at FreeBSD.org
Sat Dec 21 11:38:48 UTC 2019
Author: arrowd (ports committer)
Date: Sat Dec 21 11:38:48 2019
New Revision: 355980
URL: https://svnweb.freebsd.org/changeset/base/355980
Log:
Don't shift 32-bit value by more than 32 bits.
PR: 207854
Approved by: emaste
Modified:
head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c
Modified: head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c
==============================================================================
--- head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Sat Dec 21 07:38:14 2019 (r355979)
+++ head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Sat Dec 21 11:38:48 2019 (r355980)
@@ -1468,7 +1468,7 @@ static t_Error CalcWredCurve(t_QmCgWredCurve *p_WredCu
for (tmpA=(uint32_t)(64*pres) ; tmpA<128*pres; tmpA += pres )
for (tmpN=7 ; tmpN<64; tmpN++ )
{
- tmp = ABS((int)(slope - tmpA/(1<<tmpN)));
+ tmp = ABS((int)(slope - tmpA/(1UL<<(tmpN%32))));
if (tmp < gap)
{
sa = tmpA;
More information about the svn-src-all
mailing list