summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Luick <dean.luick@intel.com>2016-04-12 19:50:35 +0200
committerDoug Ledford <dledford@redhat.com>2016-04-28 22:32:27 +0200
commit60d585ad6e64bac87a676df4d941c823360f6ae1 (patch)
treea44dab109b41b5567a2a7e993f01d6dbb61cdf3c
parentIB/hfi1: Correctly obtain the full service class (diff)
downloadlinux-60d585ad6e64bac87a676df4d941c823360f6ae1.tar.xz
linux-60d585ad6e64bac87a676df4d941c823360f6ae1.zip
IB/hfi1: Simplify init_qpmap_table()
Make init_qpmap_table() easier to understand by simplifying the loop indexing and writing each register when it is "full", removing the need for a follow-on register write. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/staging/rdma/hfi1/chip.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 79dc29ae6e68..56753c65b614 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -13451,20 +13451,17 @@ static void init_qpmap_table(struct hfi1_devdata *dd,
int i;
u64 ctxt = first_ctxt;
- for (i = 0; i < 256;) {
+ for (i = 0; i < 256; i++) {
reg |= ctxt << (8 * (i % 8));
- i++;
ctxt++;
if (ctxt > last_ctxt)
ctxt = first_ctxt;
- if (i % 8 == 0) {
+ if (i % 8 == 7) {
write_csr(dd, regno, reg);
reg = 0;
regno += 8;
}
}
- if (i % 8)
- write_csr(dd, regno, reg);
add_rcvctrl(dd, RCV_CTRL_RCV_QP_MAP_ENABLE_SMASK
| RCV_CTRL_RCV_BYPASS_ENABLE_SMASK);