Date: Sat, 21 Dec 2019 11:38:48 +0000 (UTC) From: Gleb Popov <arrowd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355980 - head/sys/contrib/ncsw/Peripherals/QM Message-ID: <201912211138.xBLBcmhQ001607@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912211138.xBLBcmhQ001607>