Detach sched.h from mm.h
[deliverable/linux.git] / drivers / infiniband / hw / mthca / mthca_srq.c
index 10684da33d5853e18e0cea25d9b219fbcd2b3b54..b8f05a52667376830b8dd450261341b49cb30fe8 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/sched.h>
 
 #include <asm/io.h>
 
@@ -116,11 +117,16 @@ static void mthca_arbel_init_srq_context(struct mthca_dev *dev,
                                         struct mthca_srq *srq,
                                         struct mthca_arbel_srq_context *context)
 {
-       int logsize;
+       int logsize, max;
 
        memset(context, 0, sizeof *context);
 
-       logsize = ilog2(srq->max);
+       /*
+        * Put max in a temporary variable to work around gcc bug
+        * triggered by ilog2() on sparc64.
+        */
+       max = srq->max;
+       logsize = ilog2(max);
        context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn);
        context->lkey = cpu_to_be32(srq->mr.ibmr.lkey);
        context->db_index = cpu_to_be32(srq->db_index);
This page took 0.028382 seconds and 5 git commands to generate.