On Thu, May 18, 2017 at 10:00 AM, Oleg Bulyzhin <o...@freebsd.org> wrote:
> On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote: > > > > Can you explain a bit more what is wrong? > > > > > If you care about readability it should be: > > > ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK)) > > > > Isn't this exactly what the patch is doing? -R ??? > > Current version is shifting pri out of uint16. If you examine parentheses: > pri is shifted left 13, then 12. > Original version did it right (shift 1, then 12 (total 13)). > Calculations in the C abstract machine would be performed in the 'int' type to which uint16 operands are promoted, though. -Ben _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"