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 <[email protected]>
Sam
________________________________________
Date: Tue, 16 Sep 2014 19:06:07 -0700
From: Nithin Raju <[email protected]>
To: [email protected], [email protected],
[email protected], [email protected]
Subject: [ovs-dev] [PATCH 1/5 v1] datapath-windows: return TRUE on
success in NlAttrValidate
Message-ID: <[email protected]>
Signed-off-by: Nithin Raju <[email protected]>
---
datapath-windows/ovsext/Netlink/Netlink.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/datapath-windows/ovsext/Netlink/Netlink.c
b/datapath-windows/ovsext/Netlink/Netlink.c
index 5faf07f..f6ee4c4 100644
--- a/datapath-windows/ovsext/Netlink/Netlink.c
+++ b/datapath-windows/ovsext/Netlink/Netlink.c
@@ -819,6 +819,7 @@ NlAttrValidate(const PNL_ATTR nla, const PNL_POLICY policy)
goto done;
}
}
+ ret = TRUE;
done:
return ret;
--
1.7.4.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev