Skip to content

Commit 8e3e07c

Browse files
jgunthorperleon
authored andcommitted
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>
1 parent 69309e1 commit 8e3e07c

13 files changed

Lines changed: 21 additions & 19 deletions

File tree

drivers/infiniband/hw/efa/efa_verbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ int efa_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
682682
struct efa_com_create_qp_result create_qp_resp;
683683
struct efa_dev *dev = to_edev(ibqp->device);
684684
struct efa_ibv_create_qp_resp resp = {};
685-
struct efa_ibv_create_qp cmd = {};
685+
struct efa_ibv_create_qp cmd;
686686
struct efa_qp *qp = to_eqp(ibqp);
687687
struct efa_ucontext *ucontext;
688688
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,
11211121
struct efa_com_create_cq_result result;
11221122
struct ib_device *ibdev = ibcq->device;
11231123
struct efa_dev *dev = to_edev(ibdev);
1124-
struct efa_ibv_create_cq cmd = {};
1124+
struct efa_ibv_create_cq cmd;
11251125
struct efa_cq *cq = to_ecq(ibcq);
11261126
int entries = attr->cqe;
11271127
bool set_src_addr;

drivers/infiniband/hw/hns/hns_roce_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
425425
struct hns_roce_ucontext *context = to_hr_ucontext(uctx);
426426
struct hns_roce_dev *hr_dev = to_hr_dev(uctx->device);
427427
struct hns_roce_ib_alloc_ucontext_resp resp = {};
428-
struct hns_roce_ib_alloc_ucontext ucmd = {};
428+
struct hns_roce_ib_alloc_ucontext ucmd;
429429
int ret = -EAGAIN;
430430

431431
if (!hr_dev->active)

drivers/infiniband/hw/hns/hns_roce_srq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static int alloc_srq_db(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq,
406406
struct ib_udata *udata,
407407
struct hns_roce_ib_create_srq_resp *resp)
408408
{
409-
struct hns_roce_ib_create_srq ucmd = {};
409+
struct hns_roce_ib_create_srq ucmd;
410410
struct hns_roce_ucontext *uctx;
411411
int ret;
412412

drivers/infiniband/hw/mana/cq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
1313
struct mana_ib_create_cq_resp resp = {};
1414
struct mana_ib_ucontext *mana_ucontext;
1515
struct ib_device *ibdev = ibcq->device;
16-
struct mana_ib_create_cq ucmd = {};
16+
struct mana_ib_create_cq ucmd;
1717
struct mana_ib_dev *mdev;
1818
bool is_rnic_cq;
1919
u32 doorbell;

drivers/infiniband/hw/mana/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
8181
container_of(pd->device, struct mana_ib_dev, ib_dev);
8282
struct ib_rwq_ind_table *ind_tbl = attr->rwq_ind_tbl;
8383
struct mana_ib_create_qp_rss_resp resp = {};
84-
struct mana_ib_create_qp_rss ucmd = {};
84+
struct mana_ib_create_qp_rss ucmd;
8585
mana_handle_t *mana_ind_table;
8686
struct mana_port_context *mpc;
8787
unsigned int ind_tbl_size;

drivers/infiniband/hw/mana/wq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct ib_wq *mana_ib_create_wq(struct ib_pd *pd,
1111
{
1212
struct mana_ib_dev *mdev =
1313
container_of(pd->device, struct mana_ib_dev, ib_dev);
14-
struct mana_ib_create_wq ucmd = {};
14+
struct mana_ib_create_wq ucmd;
1515
struct mana_ib_wq *wq;
1616
int err;
1717

drivers/infiniband/hw/mlx4/qp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ static int _mlx4_ib_create_qp_rss(struct ib_pd *pd, struct mlx4_ib_qp *qp,
709709
struct ib_qp_init_attr *init_attr,
710710
struct ib_udata *udata)
711711
{
712-
struct mlx4_ib_create_qp_rss ucmd = {};
712+
struct mlx4_ib_create_qp_rss ucmd;
713713
int err;
714714

715715
if (!udata) {
@@ -4230,7 +4230,7 @@ int mlx4_ib_modify_wq(struct ib_wq *ibwq, struct ib_wq_attr *wq_attr,
42304230
u32 wq_attr_mask, struct ib_udata *udata)
42314231
{
42324232
struct mlx4_ib_qp *qp = to_mqp((struct ib_qp *)ibwq);
4233-
struct mlx4_ib_modify_wq ucmd = {};
4233+
struct mlx4_ib_modify_wq ucmd;
42344234
enum ib_wq_state cur_state, new_state;
42354235
int err;
42364236

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
720720
int *cqe_size, int *index, int *inlen,
721721
struct uverbs_attr_bundle *attrs)
722722
{
723-
struct mlx5_ib_create_cq ucmd = {};
723+
struct mlx5_ib_create_cq ucmd;
724724
unsigned long page_size;
725725
unsigned int page_offset_quantized;
726726
__be64 *pas;

drivers/infiniband/hw/mlx5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ static int mlx5_ib_alloc_ucontext(struct ib_ucontext *uctx,
21782178
{
21792179
struct ib_device *ibdev = uctx->device;
21802180
struct mlx5_ib_dev *dev = to_mdev(ibdev);
2181-
struct mlx5_ib_alloc_ucontext_req_v2 req = {};
2181+
struct mlx5_ib_alloc_ucontext_req_v2 req;
21822182
struct mlx5_ib_alloc_ucontext_resp resp = {};
21832183
struct mlx5_ib_ucontext *context = to_mucontext(uctx);
21842184
struct mlx5_bfreg_info *bfregi;

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4692,7 +4692,7 @@ int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
46924692
struct mlx5_ib_dev *dev = to_mdev(ibqp->device);
46934693
struct mlx5_ib_modify_qp_resp resp = {};
46944694
struct mlx5_ib_qp *qp = to_mqp(ibqp);
4695-
struct mlx5_ib_modify_qp ucmd = {};
4695+
struct mlx5_ib_modify_qp ucmd;
46964696
enum ib_qp_type qp_type;
46974697
enum ib_qp_state cur_state, new_state;
46984698
int err = -EINVAL;
@@ -5379,7 +5379,7 @@ static int prepare_user_rq(struct ib_pd *pd,
53795379
struct mlx5_ib_rwq *rwq)
53805380
{
53815381
struct mlx5_ib_dev *dev = to_mdev(pd->device);
5382-
struct mlx5_ib_create_wq ucmd = {};
5382+
struct mlx5_ib_create_wq ucmd;
53835383
int err;
53845384

53855385
err = ib_copy_validate_udata_in_cm(udata, ucmd,

0 commit comments

Comments
 (0)