mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
RDMA: Remove redundant = {} for udata req structs
Now that all of the udata request structs are loaded with the helpers the callers should not pre-zero them. The helpers all guarantee that the entire struct is filled with something. Reviewed-by: Long Li <longli@microsoft.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
This commit is contained in:
parent
69309e1729
commit
8e3e07cca0
|
|
@ -682,7 +682,7 @@ int efa_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
|
|||
struct efa_com_create_qp_result create_qp_resp;
|
||||
struct efa_dev *dev = to_edev(ibqp->device);
|
||||
struct efa_ibv_create_qp_resp resp = {};
|
||||
struct efa_ibv_create_qp cmd = {};
|
||||
struct efa_ibv_create_qp cmd;
|
||||
struct efa_qp *qp = to_eqp(ibqp);
|
||||
struct efa_ucontext *ucontext;
|
||||
u16 supported_efa_flags = 0;
|
||||
|
|
@ -1121,7 +1121,7 @@ int efa_create_user_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|||
struct efa_com_create_cq_result result;
|
||||
struct ib_device *ibdev = ibcq->device;
|
||||
struct efa_dev *dev = to_edev(ibdev);
|
||||
struct efa_ibv_create_cq cmd = {};
|
||||
struct efa_ibv_create_cq cmd;
|
||||
struct efa_cq *cq = to_ecq(ibcq);
|
||||
int entries = attr->cqe;
|
||||
bool set_src_addr;
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
|
|||
struct hns_roce_ucontext *context = to_hr_ucontext(uctx);
|
||||
struct hns_roce_dev *hr_dev = to_hr_dev(uctx->device);
|
||||
struct hns_roce_ib_alloc_ucontext_resp resp = {};
|
||||
struct hns_roce_ib_alloc_ucontext ucmd = {};
|
||||
struct hns_roce_ib_alloc_ucontext ucmd;
|
||||
int ret = -EAGAIN;
|
||||
|
||||
if (!hr_dev->active)
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ static int alloc_srq_db(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq,
|
|||
struct ib_udata *udata,
|
||||
struct hns_roce_ib_create_srq_resp *resp)
|
||||
{
|
||||
struct hns_roce_ib_create_srq ucmd = {};
|
||||
struct hns_roce_ib_create_srq ucmd;
|
||||
struct hns_roce_ucontext *uctx;
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|||
struct mana_ib_create_cq_resp resp = {};
|
||||
struct mana_ib_ucontext *mana_ucontext;
|
||||
struct ib_device *ibdev = ibcq->device;
|
||||
struct mana_ib_create_cq ucmd = {};
|
||||
struct mana_ib_create_cq ucmd;
|
||||
struct mana_ib_dev *mdev;
|
||||
bool is_rnic_cq;
|
||||
u32 doorbell;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
|
|||
container_of(pd->device, struct mana_ib_dev, ib_dev);
|
||||
struct ib_rwq_ind_table *ind_tbl = attr->rwq_ind_tbl;
|
||||
struct mana_ib_create_qp_rss_resp resp = {};
|
||||
struct mana_ib_create_qp_rss ucmd = {};
|
||||
struct mana_ib_create_qp_rss ucmd;
|
||||
mana_handle_t *mana_ind_table;
|
||||
struct mana_port_context *mpc;
|
||||
unsigned int ind_tbl_size;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ struct ib_wq *mana_ib_create_wq(struct ib_pd *pd,
|
|||
{
|
||||
struct mana_ib_dev *mdev =
|
||||
container_of(pd->device, struct mana_ib_dev, ib_dev);
|
||||
struct mana_ib_create_wq ucmd = {};
|
||||
struct mana_ib_create_wq ucmd;
|
||||
struct mana_ib_wq *wq;
|
||||
int err;
|
||||
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ static int _mlx4_ib_create_qp_rss(struct ib_pd *pd, struct mlx4_ib_qp *qp,
|
|||
struct ib_qp_init_attr *init_attr,
|
||||
struct ib_udata *udata)
|
||||
{
|
||||
struct mlx4_ib_create_qp_rss ucmd = {};
|
||||
struct mlx4_ib_create_qp_rss ucmd;
|
||||
int err;
|
||||
|
||||
if (!udata) {
|
||||
|
|
@ -4230,7 +4230,7 @@ int mlx4_ib_modify_wq(struct ib_wq *ibwq, struct ib_wq_attr *wq_attr,
|
|||
u32 wq_attr_mask, struct ib_udata *udata)
|
||||
{
|
||||
struct mlx4_ib_qp *qp = to_mqp((struct ib_qp *)ibwq);
|
||||
struct mlx4_ib_modify_wq ucmd = {};
|
||||
struct mlx4_ib_modify_wq ucmd;
|
||||
enum ib_wq_state cur_state, new_state;
|
||||
int err;
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
|
|||
int *cqe_size, int *index, int *inlen,
|
||||
struct uverbs_attr_bundle *attrs)
|
||||
{
|
||||
struct mlx5_ib_create_cq ucmd = {};
|
||||
struct mlx5_ib_create_cq ucmd;
|
||||
unsigned long page_size;
|
||||
unsigned int page_offset_quantized;
|
||||
__be64 *pas;
|
||||
|
|
|
|||
|
|
@ -2178,7 +2178,7 @@ static int mlx5_ib_alloc_ucontext(struct ib_ucontext *uctx,
|
|||
{
|
||||
struct ib_device *ibdev = uctx->device;
|
||||
struct mlx5_ib_dev *dev = to_mdev(ibdev);
|
||||
struct mlx5_ib_alloc_ucontext_req_v2 req = {};
|
||||
struct mlx5_ib_alloc_ucontext_req_v2 req;
|
||||
struct mlx5_ib_alloc_ucontext_resp resp = {};
|
||||
struct mlx5_ib_ucontext *context = to_mucontext(uctx);
|
||||
struct mlx5_bfreg_info *bfregi;
|
||||
|
|
|
|||
|
|
@ -4692,7 +4692,7 @@ int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
|||
struct mlx5_ib_dev *dev = to_mdev(ibqp->device);
|
||||
struct mlx5_ib_modify_qp_resp resp = {};
|
||||
struct mlx5_ib_qp *qp = to_mqp(ibqp);
|
||||
struct mlx5_ib_modify_qp ucmd = {};
|
||||
struct mlx5_ib_modify_qp ucmd;
|
||||
enum ib_qp_type qp_type;
|
||||
enum ib_qp_state cur_state, new_state;
|
||||
int err = -EINVAL;
|
||||
|
|
@ -5379,7 +5379,7 @@ static int prepare_user_rq(struct ib_pd *pd,
|
|||
struct mlx5_ib_rwq *rwq)
|
||||
{
|
||||
struct mlx5_ib_dev *dev = to_mdev(pd->device);
|
||||
struct mlx5_ib_create_wq ucmd = {};
|
||||
struct mlx5_ib_create_wq ucmd;
|
||||
int err;
|
||||
|
||||
err = ib_copy_validate_udata_in_cm(udata, ucmd,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static int create_srq_user(struct ib_pd *pd, struct mlx5_ib_srq *srq,
|
|||
struct ib_udata *udata, int buf_size)
|
||||
{
|
||||
struct mlx5_ib_dev *dev = to_mdev(pd->device);
|
||||
struct mlx5_ib_create_srq ucmd = {};
|
||||
struct mlx5_ib_create_srq ucmd;
|
||||
struct mlx5_ib_ucontext *ucontext = rdma_udata_to_drv_context(
|
||||
udata, struct mlx5_ib_ucontext, ibucontext);
|
||||
int err;
|
||||
|
|
|
|||
|
|
@ -1308,12 +1308,14 @@ int ocrdma_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *attrs,
|
|||
if (status)
|
||||
goto gen_err;
|
||||
|
||||
memset(&ureq, 0, sizeof(ureq));
|
||||
if (udata) {
|
||||
status = ib_copy_validate_udata_in(udata, ureq, rsvd1);
|
||||
if (status)
|
||||
return status;
|
||||
} else {
|
||||
memset(&ureq, 0, sizeof(ureq));
|
||||
}
|
||||
|
||||
ocrdma_set_qp_init_params(qp, pd, attrs);
|
||||
if (udata == NULL)
|
||||
qp->cap_flags |= (OCRDMA_QP_MW_BIND | OCRDMA_QP_LKEY0 |
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ int qedr_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
|
|||
int rc;
|
||||
struct qedr_ucontext *ctx = get_qedr_ucontext(uctx);
|
||||
struct qedr_alloc_ucontext_resp uresp = {};
|
||||
struct qedr_alloc_ucontext_req ureq = {};
|
||||
struct qedr_alloc_ucontext_req ureq;
|
||||
struct qedr_dev *dev = get_qedr_dev(ibdev);
|
||||
struct qed_rdma_add_user_out_params oparams;
|
||||
struct qedr_user_mmap_entry *entry;
|
||||
|
|
@ -913,7 +913,7 @@ int qedr_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
|
|||
};
|
||||
struct qedr_dev *dev = get_qedr_dev(ibdev);
|
||||
struct qed_rdma_create_cq_in_params params;
|
||||
struct qedr_create_cq_ureq ureq = {};
|
||||
struct qedr_create_cq_ureq ureq;
|
||||
int vector = attr->comp_vector;
|
||||
int entries = attr->cqe;
|
||||
struct qedr_cq *cq = get_qedr_cq(ibcq);
|
||||
|
|
@ -1541,7 +1541,7 @@ int qedr_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init_attr,
|
|||
struct qedr_dev *dev = get_qedr_dev(ibsrq->device);
|
||||
struct qed_rdma_create_srq_out_params out_params;
|
||||
struct qedr_pd *pd = get_qedr_pd(ibsrq->pd);
|
||||
struct qedr_create_srq_ureq ureq = {};
|
||||
struct qedr_create_srq_ureq ureq;
|
||||
u64 pbl_base_addr, phy_prod_pair_addr;
|
||||
struct qedr_srq_hwq_info *hw_srq;
|
||||
u32 page_cnt, page_size;
|
||||
|
|
@ -1837,7 +1837,7 @@ static int qedr_create_user_qp(struct qedr_dev *dev,
|
|||
struct qed_rdma_create_qp_in_params in_params;
|
||||
struct qed_rdma_create_qp_out_params out_params;
|
||||
struct qedr_create_qp_uresp uresp = {};
|
||||
struct qedr_create_qp_ureq ureq = {};
|
||||
struct qedr_create_qp_ureq ureq;
|
||||
int alloc_and_init = rdma_protocol_roce(&dev->ibdev, 1);
|
||||
struct qedr_ucontext *ctx = NULL;
|
||||
struct qedr_pd *pd = NULL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user