Re: [PATCH 2/2] nvmet: remove workarounds for gcc bug wrt unnamed fields in initializers

Chaitanya Kulkarni
2020-06-18T15:23:27Z

On 6/18/20 7:32 AM, Niklas Cassel wrote:
> drivers/nvme/target/rdma.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index 6731e0349480..85c6ff0b0e44 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1535,19 +1535,20 @@ static int nvmet_rdma_cm_accept(struct rdma_cm_id *cm_id,
> struct nvmet_rdma_queue *queue,
> struct rdma_conn_param *p)
> {
> - struct rdma_conn_param param = { };
> - struct nvme_rdma_cm_rep priv = { };
> + struct rdma_conn_param param = {
> + .rnr_retry_count = 7,
> + .flow_control = 1,
> + .initiator_depth = min_t(u8, p->initiator_depth,
> + queue->dev->device->attrs.max_qp_init_rd_atom),
> + .private_data = &priv,
> + .private_data_len = sizeof(priv),
> + };
> + struct nvme_rdma_cm_rep priv = {
> + .recfmt = cpu_to_le16(NVME_RDMA_CM_FMT_1_0),
> + .crqsize = cpu_to_le16(queue->recv_queue_size),
> + };
> int ret = -ENOMEM;
>
> - param.rnr_retry_count = 7;
> - param.flow_control = 1;
> - param.initiator_depth = min_t(u8, p->initiator_depth,
> - queue->dev->device->attrs.max_qp_init_rd_atom);
> - param.private_data = &priv;
> - param.private_data_len = sizeof(priv);
> - priv.recfmt = cpu_to_le16(NVME_RDMA_CM_FMT_1_0);
> - priv.crqsize = cpu_to_le16(queue->recv_queue_size);
> -
> ret = rdma_accept(cm_id, &param);
> if (ret)
> pr_err("rdma_accept failed (error code = %d)\n", ret);
> -- 2.26.2

What is the issue with existing code that we need this patch for ?