[ovs-dev] [PATCH 1/5 v1] datapath-windows: return TRUE on success in NlAttrValidate

Nithin Raju nithin at vmware.com
Thu Sep 18 20:46:10 UTC 2014


On Sep 18, 2014, at 4:35 AM, Samuel Ghinet <sghinet at cloudbasesolutions.com>
 wrote:

> Hi Nithin,
> 
> Good catch!
> 
> I would normally prefer the validation in a function to be done like:
> ret = TRUE;
> 
> if (fail_cond_1) {
>  log();
>  ret = FALSE;
>  goto done;
> }
> 
> if (fail_cond_2) {
>  log();
>  ret = FALSE;
>  goto done;
> }
> 
> done:
> return ret;
> 
> It would be a bit more text, but I think it improves clarity a bit on the ways "ret" is used and changed.
> 
> Anyway, it's good the way it is in NlAttrValidate as well.
> 
> Acked-by: Samuel Ghinet <sghinet at cloudbasesolutions.com>

Thanks for the review. I've incorporated your comments.

-- Nithin


More information about the dev mailing list