[dpdk-dev] [PATCH 2/4] net/failsafe: change back-reference from sub-device

Stephen Hemminger stephen at networkplumber.org
Thu Feb 28 18:16:19 CET 2019


On Thu, 28 Feb 2019 15:49:26 +0000
Raslan Darawsheh <rasland at mellanox.com> wrote:

> +/* sdev: (struct sub_device *) */
> +#define FSDEV_FROM_SUBDEV(sdev) \
> +	(&rte_eth_devices[sdev->fs_port_id])

If at all possible, inline functions are preferable to macros because
inline functions don't allow side effects and keep the type checking.

This could just be an inline function without any impact to code
generation.


More information about the dev mailing list