Re: [dpdk-dev] [PATCH 2/7] ethdev: reduce goto's in attach/detach

2017-02-01 Thread Ferruh Yigit
On 1/10/2017 8:40 AM, Thomas Monjalon wrote: > Hi Stephen, > > Please use --in-reply-to to keep v1 and v2 in the same thread. > > Comment below > > > 2017-01-09 15:30, Stephen Hemminger: >> int >> rte_eth_dev_detach(uint8_t port_id, char *name) >> { >> -int ret = -1; >> +int ret; >>

Re: [dpdk-dev] [PATCH 2/7] ethdev: reduce goto's in attach/detach

2017-01-10 Thread Thomas Monjalon
Hi Stephen, Please use --in-reply-to to keep v1 and v2 in the same thread. Comment below 2017-01-09 15:30, Stephen Hemminger: > int > rte_eth_dev_detach(uint8_t port_id, char *name) > { > - int ret = -1; > + int ret; > > - if (name == NULL) { > - ret = -EINVAL; > -

[dpdk-dev] [PATCH 2/7] ethdev: reduce goto's in attach/detach

2017-01-09 Thread Stephen Hemminger
Extra goto's to just a return are unnecessary. Don't do unnecessary initialization. Propgate return value. Signed-off-by: Stephen Hemminger --- lib/librte_ether/rte_ethdev.c | 52 +-- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/lib/libr