[dpdk-dev] [PATCH v6 1/2] eal: add uevent monitor for hot plug

Stephen Hemminger stephen at networkplumber.org
Wed Nov 1 22:36:59 CET 2017


On Thu,  2 Nov 2017 04:16:44 +0800
Jeff Guo <jia.guo at 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;
> +}


More information about the dev mailing list