IB/hfi1: Correct issues with sc5 computation
commit896ce45da2c2f4abc508d443fdecde7de0b3fa7e
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 1 Jul 2016 22:57:02 +0000 (1 15:57 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 12 Jul 2016 14:46:24 +0000 (12 10:46 -0400)
tree4e83c3712ac135406a6d57a999e6ff8a5d5c71a6
parent9903fd1374e913f5086b58af09d4e3fd6e9e86fe
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