Commit ecb238f6 authored by YueHaibing's avatar YueHaibing Committed by Doug Ledford

IB/cxgb4: use skb_put_zero()/__skb_put_zero

Use the recently introduced helper to replace the pattern of
skb_put_zero/__skb_put() && memset().
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 2f6e5136
...@@ -1297,8 +1297,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe, ...@@ -1297,8 +1297,7 @@ static void post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe,
set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
wqe = __skb_put(skb, sizeof(*wqe)); wqe = __skb_put_zero(skb, sizeof(*wqe));
memset(wqe, 0, sizeof *wqe);
wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR)); wqe->op_compl = cpu_to_be32(FW_WR_OP_V(FW_RI_INIT_WR));
wqe->flowid_len16 = cpu_to_be32( wqe->flowid_len16 = cpu_to_be32(
FW_WR_FLOWID_V(qhp->ep->hwtid) | FW_WR_FLOWID_V(qhp->ep->hwtid) |
...@@ -1421,8 +1420,7 @@ static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp, ...@@ -1421,8 +1420,7 @@ static int rdma_fini(struct c4iw_dev *rhp, struct c4iw_qp *qhp,
set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx); set_wr_txq(skb, CPL_PRIORITY_DATA, ep->txq_idx);
wqe = __skb_put(skb, sizeof(*wqe)); wqe = __skb_put_zero(skb, sizeof(*wqe));
memset(wqe, 0, sizeof *wqe);
wqe->op_compl = cpu_to_be32( wqe->op_compl = cpu_to_be32(
FW_WR_OP_V(FW_RI_INIT_WR) | FW_WR_OP_V(FW_RI_INIT_WR) |
FW_WR_COMPL_F); FW_WR_COMPL_F);
...@@ -1487,8 +1485,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp) ...@@ -1487,8 +1485,7 @@ static int rdma_init(struct c4iw_dev *rhp, struct c4iw_qp *qhp)
} }
set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx); set_wr_txq(skb, CPL_PRIORITY_DATA, qhp->ep->txq_idx);
wqe = __skb_put(skb, sizeof(*wqe)); wqe = __skb_put_zero(skb, sizeof(*wqe));
memset(wqe, 0, sizeof *wqe);
wqe->op_compl = cpu_to_be32( wqe->op_compl = cpu_to_be32(
FW_WR_OP_V(FW_RI_INIT_WR) | FW_WR_OP_V(FW_RI_INIT_WR) |
FW_WR_COMPL_F); FW_WR_COMPL_F);
......
...@@ -565,11 +565,9 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av, ...@@ -565,11 +565,9 @@ struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
pkt->rxe = rxe; pkt->rxe = rxe;
pkt->port_num = port_num; pkt->port_num = port_num;
pkt->hdr = skb_put(skb, paylen); pkt->hdr = skb_put_zero(skb, paylen);
pkt->mask |= RXE_GRH_MASK; pkt->mask |= RXE_GRH_MASK;
memset(pkt->hdr, 0, paylen);
dev_put(ndev); dev_put(ndev);
return skb; return skb;
} }
......
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