提交 8fc394b1 编写于 作者: H Hal Rosenstock 提交者: Roland Dreier

IB/mad: agent_send_response() should be void

Nothing looks at the return value of agent_send_response(), so there's
no point in returning anything.
Signed-off-by: NHal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 86dfbecd
...@@ -78,15 +78,14 @@ ib_get_agent_port(struct ib_device *device, int port_num) ...@@ -78,15 +78,14 @@ ib_get_agent_port(struct ib_device *device, int port_num)
return entry; return entry;
} }
int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
struct ib_wc *wc, struct ib_device *device, struct ib_wc *wc, struct ib_device *device,
int port_num, int qpn) int port_num, int qpn)
{ {
struct ib_agent_port_private *port_priv; struct ib_agent_port_private *port_priv;
struct ib_mad_agent *agent; struct ib_mad_agent *agent;
struct ib_mad_send_buf *send_buf; struct ib_mad_send_buf *send_buf;
struct ib_ah *ah; struct ib_ah *ah;
int ret;
struct ib_mad_send_wr_private *mad_send_wr; struct ib_mad_send_wr_private *mad_send_wr;
if (device->node_type == RDMA_NODE_IB_SWITCH) if (device->node_type == RDMA_NODE_IB_SWITCH)
...@@ -96,23 +95,21 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, ...@@ -96,23 +95,21 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
if (!port_priv) { if (!port_priv) {
printk(KERN_ERR SPFX "Unable to find port agent\n"); printk(KERN_ERR SPFX "Unable to find port agent\n");
return -ENODEV; return;
} }
agent = port_priv->agent[qpn]; agent = port_priv->agent[qpn];
ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num);
if (IS_ERR(ah)) { if (IS_ERR(ah)) {
ret = PTR_ERR(ah); printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n");
printk(KERN_ERR SPFX "ib_create_ah_from_wc error:%d\n", ret); return;
return ret;
} }
send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0, send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0,
IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA,
GFP_KERNEL); GFP_KERNEL);
if (IS_ERR(send_buf)) { if (IS_ERR(send_buf)) {
ret = PTR_ERR(send_buf); printk(KERN_ERR SPFX "ib_create_send_mad error\n");
printk(KERN_ERR SPFX "ib_create_send_mad error:%d\n", ret);
goto err1; goto err1;
} }
...@@ -126,16 +123,15 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, ...@@ -126,16 +123,15 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
mad_send_wr->send_wr.wr.ud.port_num = port_num; mad_send_wr->send_wr.wr.ud.port_num = port_num;
} }
if ((ret = ib_post_send_mad(send_buf, NULL))) { if (ib_post_send_mad(send_buf, NULL)) {
printk(KERN_ERR SPFX "ib_post_send_mad error:%d\n", ret); printk(KERN_ERR SPFX "ib_post_send_mad error\n");
goto err2; goto err2;
} }
return 0; return;
err2: err2:
ib_free_send_mad(send_buf); ib_free_send_mad(send_buf);
err1: err1:
ib_destroy_ah(ah); ib_destroy_ah(ah);
return ret;
} }
static void agent_send_handler(struct ib_mad_agent *mad_agent, static void agent_send_handler(struct ib_mad_agent *mad_agent,
......
...@@ -46,8 +46,8 @@ extern int ib_agent_port_open(struct ib_device *device, int port_num); ...@@ -46,8 +46,8 @@ extern int ib_agent_port_open(struct ib_device *device, int port_num);
extern int ib_agent_port_close(struct ib_device *device, int port_num); extern int ib_agent_port_close(struct ib_device *device, int port_num);
extern int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, extern void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
struct ib_wc *wc, struct ib_device *device, struct ib_wc *wc, struct ib_device *device,
int port_num, int qpn); int port_num, int qpn);
#endif /* __AGENT_H_ */ #endif /* __AGENT_H_ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册