On Tue, 20 Feb 2024 18:58:17 +0800
Jie Hai <haij...@huawei.com> wrote:

>  int
>  rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)
> +{
> +     struct rte_dev_reg_info reg_info = { 0 };
> +     int ret;
> +
> +     if (info == NULL) {
> +             RTE_ETHDEV_LOG_LINE(ERR,
> +                     "Cannot get ethdev port %u register info to NULL",
> +                     port_id);
> +             return -EINVAL;
> +     }
> +
> +     reg_info.length = info->length;
> +     reg_info.data = info->data;
> +     reg_info.names = NULL;
> +     reg_info.filter = NULL;

Those NULL assignments are unnecessary, already initialized structure.

Reply via email to