srq->last = get_wqe(srq, srq->max - 1);  
static int mthca_alloc_srq_buf(struct mthca_dev *dev, struct mthca_pd *pd,			       struct mthca_srq *srq){	struct mthca_data_seg *scatter;	void *wqe;	int err;	int i;	if (pd->ibpd.uobject)		return 0;	srq->wrid = kmalloc(srq->max * sizeof (u64), GFP_KERNEL);	if (!srq->wrid)		return -ENOMEM;	err = mthca_buf_alloc(dev, srq->max << srq->wqe_shift,			      MTHCA_MAX_DIRECT_SRQ_SIZE,			      &srq->queue, &srq->is_direct, pd, 1, &srq->mr);	if (err) {		kfree(srq->wrid);		return err;	}	/*	 * Now initialize the SRQ buffer so that all of the WQEs are	 * linked into the list of free WQEs.  In addition, set the	 * scatter list L_Keys to the sentry value of 0x100.	 */	for (i = 0; i < srq->max; ++i) {		wqe = get_wqe(srq, i);		*wqe_to_link(wqe) = i < srq->max - 1 ? i + 1 : -1;		for (scatter = wqe + sizeof (struct mthca_next_seg);		     (void *) scatter < wqe + (1 << srq->wqe_shift);		     ++scatter)			scatter->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6577ae51cf52f5fb0e4a85e673dd7bf2d0074e3e/mthca_srq.c/buggy/drivers/infiniband/hw/mthca/mthca_srq.c