(ib_comp_handler) ib_mad_thread_completion_handler, 
ib_mad_thread_completion_handler, 
static int ib_mad_port_open(struct ib_device *device,			    int port_num){	int ret, cq_size;	struct ib_mad_port_private *port_priv;	unsigned long flags;	char name[sizeof "ib_mad123"];	/* Create new device info */	port_priv = kmalloc(sizeof *port_priv, GFP_KERNEL);	if (!port_priv) {		printk(KERN_ERR PFX "No memory for ib_mad_port_private\n");		return -ENOMEM;	}	memset(port_priv, 0, sizeof *port_priv);	port_priv->device = device;	port_priv->port_num = port_num;	spin_lock_init(&port_priv->reg_lock);	INIT_LIST_HEAD(&port_priv->agent_list);	init_mad_qp(port_priv, &port_priv->qp_info[0]);	init_mad_qp(port_priv, &port_priv->qp_info[1]);	cq_size = (IB_MAD_QP_SEND_SIZE + IB_MAD_QP_RECV_SIZE) * 2;	port_priv->cq = ib_create_cq(port_priv->device,				     (ib_comp_handler)					ib_mad_thread_completion_handler,				     NULL, port_priv, cq_size);	if (IS_ERR(port_priv->cq)) {		printk(KERN_ERR PFX "Couldn't create ib_mad CQ\n");		ret = PTR_ERR(port_priv->cq);		goto error3;	}	port_priv->pd = ib_alloc_pd(device);	if (IS_ERR(port_priv->pd)) {		printk(KERN_ERR PFX "Couldn't create ib_mad PD\n");		ret = PTR_ERR(port_priv->pd);		goto error4;	}	port_priv->mr = ib_get_dma_mr(port_priv->pd, IB_ACCESS_LOCAL_WRITE);	if (IS_ERR(port_priv->mr)) {		printk(KERN_ERR PFX "Couldn't get ib_mad DMA MR\n");		ret = PTR_ERR(port_priv->mr);		goto error5;	}	ret = create_mad_qp(&port_priv->qp_info[0], IB_QPT_SMI);	if (ret)		goto error6;	ret = create_mad_qp(&port_priv->qp_info[1], IB_QPT_GSI);	if (ret)		goto error7;	snprintf(name, sizeof name, "ib_mad%d", port_num);	port_priv->wq = create_singlethread_workqueue(name);	if (!port_priv->wq) {		ret = -ENOMEM;		goto error8;	}	INIT_WORK(&port_priv->work, ib_mad_completion_handler, port_priv);	ret = ib_mad_port_start(port_priv);	if (ret) {		printk(KERN_ERR PFX "Couldn't start port\n");		goto error9;	}	spin_lock_irqsave(&ib_mad_port_list_lock, flags);	list_add_tail(&port_priv->port_list, &ib_mad_port_list);	spin_unlock_irqrestore(&ib_mad_port_list_lock, flags);	return 0;error9:	destroy_workqueue(port_priv->wq);error8:	destroy_mad_qp(&port_priv->qp_info[1]);error7:	destroy_mad_qp(&port_priv->qp_info[0]);error6:	ib_dereg_mr(port_priv->mr);error5:	ib_dealloc_pd(port_priv->pd);error4:	ib_destroy_cq(port_priv->cq);	cleanup_recv_queue(&port_priv->qp_info[1]);	cleanup_recv_queue(&port_priv->qp_info[0]);error3:	kfree(port_priv);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5dd2ce1200f4b12687d74de89a527f99e16c344e/mad.c/clean/drivers/infiniband/core/mad.c