On 5/7/17 7:40 AM, Roman Mashak wrote:
Girish Moodalbail <girish.moodalb...@oracle.com> writes:


[...]

 ip/iplink_vxlan.c | 251 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 143 insertions(+), 108 deletions(-)

diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index b4ebb13..2bd619d 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -21,6 +21,8 @@
 #include "utils.h"
 #include "ip_common.h"

+#define VXLAN_ATTRSET(attrs, type) (((attrs) & (1L << (type))) != 0)

I think you can drop '!= 0' part in the macro.

Sure it can be done that way as well. However, I have seen both forms in use in iproute2 code base, so I would like to keep this as is unless you feel strongly about it. Furthermore, running 'checkpatch.pl --strict' on the patch didn't complain too.

regards,
~Girish


[...]


+static void check_duparg(__u64 *attrs, int type, const char *key,
+                        const char *argv)
+{
+       if (!VXLAN_ATTRSET(*attrs, type)) {
+               *attrs |= (1L << type);
+               return;
+       }
+       duparg2(key, argv);
+}

[...]


Reply via email to