]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1: Correct issues with sc5 computation
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 1 Jul 2016 22:57:02 +0000 (15:57 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 12 Jul 2016 14:46:24 +0000 (10:46 -0400)
commit75fdbb8b63c3dc7495ca904ca078f1fe3153e788
tree4e83c3712ac135406a6d57a999e6ff8a5d5c71a6
parentcc46d6d7bccedb7006b3d3ce114a60039909b330
IB/hfi1: Correct issues with sc5 computation

There are several computatations of the sc in the
ud receive routine.

Besides the code duplication, all are wrong when the
sc is greater than 15.   In that case the code incorrectly
or's a 1 into the computed sc instead of 1 shifted left
by 4.

Fix precomputed sc5 by using an already implemented routine
hdr2sc() and deleting flawed duplicated code.

Cc: Stable <stable@vger.kernel.org> # 4.6+
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/ud.c