On Mon, 1 Jul 2024 23:01:17 +0300
Shani Peretz <shper...@nvidia.com> wrote:

> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -501,6 +501,15 @@ rte_pci_dump(FILE *f)
>               pci_dump_one_device(f, dev);
>       }
>  }
> +static int
> +pci_cmp_name(const struct rte_device *dev1, const void *name2)

Blank line between functions please

> +{
> +     const struct rte_pci_device *dev = RTE_DEV_TO_PCI_CONST(dev1);
> +     char name2_addr[sizeof(struct rte_pci_addr)] = {0};

This should just be a rte_pci_addr type, not char.
And don't need to initialize it.

> +     dev1->bus->parse(name2, (void *)&name2_addr);

If it was the correct type, cast would not be needed.

> +
> +     return memcmp(&name2_addr, &(dev->addr), sizeof(struct rte_pci_addr));

Use existing rte_pci_addr_cmp()

> +}

Reply via email to