Commit a6a188e4 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

libcxgb,cxgb4: use __skb_put_zero to simplfy code

use helper __skb_put_zero to replace the pattern of __skb_put() && memset()
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1baf5ebf
...@@ -64,8 +64,7 @@ static int set_tcb_field(struct adapter *adap, struct filter_entry *f, ...@@ -64,8 +64,7 @@ static int set_tcb_field(struct adapter *adap, struct filter_entry *f,
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
req = (struct cpl_set_tcb_field *)__skb_put(skb, sizeof(*req)); req = (struct cpl_set_tcb_field *)__skb_put_zero(skb, sizeof(*req));
memset(req, 0, sizeof(*req));
INIT_TP_WR_CPL(req, CPL_SET_TCB_FIELD, ftid); INIT_TP_WR_CPL(req, CPL_SET_TCB_FIELD, ftid);
req->reply_ctrl = htons(REPLY_CHAN_V(0) | req->reply_ctrl = htons(REPLY_CHAN_V(0) |
QUEUENO_V(adap->sge.fw_evtq.abs_id) | QUEUENO_V(adap->sge.fw_evtq.abs_id) |
......
...@@ -84,8 +84,7 @@ int cxgb4_get_srq_entry(struct net_device *dev, ...@@ -84,8 +84,7 @@ int cxgb4_get_srq_entry(struct net_device *dev,
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
req = (struct cpl_srq_table_req *) req = (struct cpl_srq_table_req *)
__skb_put(skb, sizeof(*req)); __skb_put_zero(skb, sizeof(*req));
memset(req, 0, sizeof(*req));
INIT_TP_WR(req, 0); INIT_TP_WR(req, 0);
OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SRQ_TABLE_REQ, OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SRQ_TABLE_REQ,
TID_TID_V(srq_idx) | TID_TID_V(srq_idx) |
......
...@@ -90,8 +90,7 @@ cxgb_mk_tid_release(struct sk_buff *skb, u32 len, u32 tid, u16 chan) ...@@ -90,8 +90,7 @@ cxgb_mk_tid_release(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
{ {
struct cpl_tid_release *req; struct cpl_tid_release *req;
req = __skb_put(skb, len); req = __skb_put_zero(skb, len);
memset(req, 0, len);
INIT_TP_WR(req, tid); INIT_TP_WR(req, tid);
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_TID_RELEASE, tid)); OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_TID_RELEASE, tid));
...@@ -104,8 +103,7 @@ cxgb_mk_close_con_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan, ...@@ -104,8 +103,7 @@ cxgb_mk_close_con_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
{ {
struct cpl_close_con_req *req; struct cpl_close_con_req *req;
req = __skb_put(skb, len); req = __skb_put_zero(skb, len);
memset(req, 0, len);
INIT_TP_WR(req, tid); INIT_TP_WR(req, tid);
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, tid)); OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_CLOSE_CON_REQ, tid));
...@@ -119,8 +117,7 @@ cxgb_mk_abort_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan, ...@@ -119,8 +117,7 @@ cxgb_mk_abort_req(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
{ {
struct cpl_abort_req *req; struct cpl_abort_req *req;
req = __skb_put(skb, len); req = __skb_put_zero(skb, len);
memset(req, 0, len);
INIT_TP_WR(req, tid); INIT_TP_WR(req, tid);
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_ABORT_REQ, tid)); OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_ABORT_REQ, tid));
...@@ -134,8 +131,7 @@ cxgb_mk_abort_rpl(struct sk_buff *skb, u32 len, u32 tid, u16 chan) ...@@ -134,8 +131,7 @@ cxgb_mk_abort_rpl(struct sk_buff *skb, u32 len, u32 tid, u16 chan)
{ {
struct cpl_abort_rpl *rpl; struct cpl_abort_rpl *rpl;
rpl = __skb_put(skb, len); rpl = __skb_put_zero(skb, len);
memset(rpl, 0, len);
INIT_TP_WR(rpl, tid); INIT_TP_WR(rpl, tid);
OPCODE_TID(rpl) = cpu_to_be32(MK_OPCODE_TID(CPL_ABORT_RPL, tid)); OPCODE_TID(rpl) = cpu_to_be32(MK_OPCODE_TID(CPL_ABORT_RPL, tid));
...@@ -149,8 +145,7 @@ cxgb_mk_rx_data_ack(struct sk_buff *skb, u32 len, u32 tid, u16 chan, ...@@ -149,8 +145,7 @@ cxgb_mk_rx_data_ack(struct sk_buff *skb, u32 len, u32 tid, u16 chan,
{ {
struct cpl_rx_data_ack *req; struct cpl_rx_data_ack *req;
req = __skb_put(skb, len); req = __skb_put_zero(skb, len);
memset(req, 0, len);
INIT_TP_WR(req, tid); INIT_TP_WR(req, tid);
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_RX_DATA_ACK, tid)); OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_RX_DATA_ACK, tid));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment