IB/hfi1: Handle initial value of 0 for CCTI setting
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Mon, 6 Nov 2017 14:39:29 +0000 (06:39 -0800)
committerDoug Ledford <dledford@redhat.com>
Mon, 13 Nov 2017 20:53:57 +0000 (15:53 -0500)
commit685894dd9bd03b92803fbc72565789713f067d4c
treeac6456ad4e32e279e35bdd7ecd6f3318e09be656
parentb64581adba467c916590c3922f64ec6c2b59a2c3
IB/hfi1: Handle initial value of 0 for CCTI setting

When the driver is loaded it sets the default CCTI value to be 0. When the FM
starts and CCA is disabled the driver sets the max value to 65535 due the driver
subtracting 1 from 0 and the fact that the CCTI value is a u16.

Special case the subtraction to find the index for a 0 value.

Reviewed-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/mad.c