On Thu,  2 Nov 2017 04:16:44 +0800
Jeff Guo <jia....@intel.com> wrote:

>  
> +/* Map pci device */
> +int
> +rte_pci_remap_device(struct rte_pci_device *dev)
> +{
> +     int ret = -1;

Please don't always initialize variables. It is unnecessary, and with
modern compilers a bad habit since it defeats the uninitailized variable
warning message which is useful to detect buggy code paths.


> +
> +     if (dev == NULL)
> +             return -EINVAL;
> +
> +     switch (dev->kdrv) {
> +     case RTE_KDRV_NIC_UIO:
> +             ret = pci_uio_remap_resource(dev);
> +             break;
> +     default:
> +             RTE_LOG(DEBUG, EAL,
> +                     "  Not managed by a supported kernel driver, 
> skipped\n");
> +             ret = 1;
> +             break;
> +     }
> +
> +     return ret;
> +}

Reply via email to