diff options
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 10684da33d58..61974b0296ca 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c | |||
@@ -116,11 +116,16 @@ static void mthca_arbel_init_srq_context(struct mthca_dev *dev, | |||
116 | struct mthca_srq *srq, | 116 | struct mthca_srq *srq, |
117 | struct mthca_arbel_srq_context *context) | 117 | struct mthca_arbel_srq_context *context) |
118 | { | 118 | { |
119 | int logsize; | 119 | int logsize, max; |
120 | 120 | ||
121 | memset(context, 0, sizeof *context); | 121 | memset(context, 0, sizeof *context); |
122 | 122 | ||
123 | logsize = ilog2(srq->max); | 123 | /* |
124 | * Put max in a temporary variable to work around gcc bug | ||
125 | * triggered by ilog2() on sparc64. | ||
126 | */ | ||
127 | max = srq->max; | ||
128 | logsize = ilog2(max); | ||
124 | context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn); | 129 | context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn); |
125 | context->lkey = cpu_to_be32(srq->mr.ibmr.lkey); | 130 | context->lkey = cpu_to_be32(srq->mr.ibmr.lkey); |
126 | context->db_index = cpu_to_be32(srq->db_index); | 131 | context->db_index = cpu_to_be32(srq->db_index); |