summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/chip.c
diff options
context:
space:
mode:
authorMichael J. Ruhl2017-07-24 16:45:55 +0200
committerDoug Ledford2017-07-31 21:17:55 +0200
commite6f7622df177d594f11d93343c3dda7637c761e0 (patch)
treec95e9c99c6e30e383d71a45f8addb510e2254ad2 /drivers/infiniband/hw/hfi1/chip.c
parentIB/hfi1: Remove unused user context data members (diff)
downloadkernel-qcow2-linux-e6f7622df177d594f11d93343c3dda7637c761e0.tar.gz
kernel-qcow2-linux-e6f7622df177d594f11d93343c3dda7637c761e0.tar.xz
kernel-qcow2-linux-e6f7622df177d594f11d93343c3dda7637c761e0.zip
IB/hfi1: Size rcd array index correctly and consistently
The array index for the rcd array is sized several different ways throughout the code. Use the user interface size (u16) as the standard size and update the necessary code to reflect this. u16 is large enough for the largest amount of supported contexts. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/chip.c')
-rw-r--r--drivers/infiniband/hw/hfi1/chip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
index 4fce173c8667..06a79a268d2e 100644
--- a/drivers/infiniband/hw/hfi1/chip.c
+++ b/drivers/infiniband/hw/hfi1/chip.c
@@ -6802,7 +6802,7 @@ static void rxe_freeze(struct hfi1_devdata *dd)
static void rxe_kernel_unfreeze(struct hfi1_devdata *dd)
{
u32 rcvmask;
- int i;
+ u16 i;
/* enable all kernel contexts */
for (i = 0; i < dd->num_rcv_contexts; i++) {
@@ -11722,7 +11722,7 @@ static u32 encoded_size(u32 size)
return 0x1; /* if invalid, go with the minimum size */
}
-void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt)
+void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, u16 ctxt)
{
struct hfi1_ctxtdata *rcd;
u64 rcvctrl, reg;
@@ -14542,7 +14542,7 @@ static void init_txe(struct hfi1_devdata *dd)
write_csr(dd, SEND_CM_TIMER_CTRL, HFI1_CREDIT_RETURN_RATE);
}
-int hfi1_set_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt, u16 jkey)
+int hfi1_set_ctxt_jkey(struct hfi1_devdata *dd, u16 ctxt, u16 jkey)
{
struct hfi1_ctxtdata *rcd = dd->rcd[ctxt];
unsigned sctxt;
@@ -14579,7 +14579,7 @@ done:
return ret;
}
-int hfi1_clear_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt)
+int hfi1_clear_ctxt_jkey(struct hfi1_devdata *dd, u16 ctxt)
{
struct hfi1_ctxtdata *rcd = dd->rcd[ctxt];
unsigned sctxt;
@@ -14608,7 +14608,7 @@ done:
return ret;
}
-int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt, u16 pkey)
+int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, u16 ctxt, u16 pkey)
{
struct hfi1_ctxtdata *rcd;
unsigned sctxt;