[dpdk-dev] [PATCH V5 5/7] bus: add helper to handle sigbus

He, Shaopeng shaopeng.he at intel.com
Fri Jul 6 17:22:01 CEST 2018


> -----Original Message-----
> From: Guo, Jia
> Sent: Thursday, July 5, 2018 3:39 PM
> 
> This patch aim to add a helper to iterate all buses to find the
> corresponding bus to handle the sigbus error.
> 

[...]

> +	bus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr);
> +	/* failed to handle the sigbus, pass the new errno. */
> +	if (bus && rte_errno == -1)
> +		return -1;
> +	else if (!bus)
> +		ret = 1;

Change the compare order, code will be a little bit shorter?
	if (!bus)
		ret = 1
	else if (rte_errno == -1)
		return -1;

[...]

Acked-by: Shaopeng He <shaopeng.he at intel.com>



More information about the dev mailing list