On Mon, 10 Feb 2025 09:50:10 +0800
Bingbin Chen <chen.bing...@zte.com.cn> wrote:

> +static uint32_t
> +zxdh_np_agent_channel_se_res_get(uint32_t dev_id,
> +                                                             uint32_t 
> sub_type,
> +                                                             uint32_t opr,
> +                                                             uint32_t 
> *p_rsp_buff,
> +                                                             uint32_t 
> buff_size)
> +{
> +     uint32_t rc = ZXDH_OK;
> +
> +     uint32_t msg_result = 0;
> +     ZXDH_AGENT_SE_RES_MSG_T msgcfg = {0};
> +     ZXDH_AGENT_CHANNEL_MSG_T agent_msg = {0};
> +
> +     msgcfg.dev_id = 0;
> +     msgcfg.type = ZXDH_RES_MSG;
> +     msgcfg.sub_type = sub_type;
> +     msgcfg.oper = opr;
> +     agent_msg.msg = (void *)&msgcfg;
> +     agent_msg.msg_len = sizeof(ZXDH_AGENT_SE_RES_MSG_T);

All this would be more readable as one initializer

        ZXDH_AGENT_SE_RES_MSG_T msgcfg = {
                .dev_id = 0,
                .type = ZXDH_RES_MSG,
                .sub_type = sub_type,
                .oper = opr,
        };

etc.

Reply via email to