[dpdk-dev] [PATCH 3/4] net/failsafe: replace local sub-device with shared data

Stephen Hemminger stephen at networkplumber.org
Thu Feb 28 18:22:09 CET 2019


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

>  
>  /* sdev: (struct sub_device *) */
>  #define ETH(sdev) \
> -	((sdev)->edev)
> +	(sdev->data == NULL ? NULL : &rte_eth_devices[sdev->data->port_id])

Macro arguments should always be parenthesised and you can shorten
by using abbreviated trigraph.

#define ETH(sdev) \
	((sdev)->data ? &rte_eth_devices[(sdev)->data->port_id] : )


More information about the dev mailing list