[ovs-dev] [PATCH] Fully initialize data structures.

Ben Pfaff blp at nicira.com
Fri Jul 19 17:09:47 UTC 2013


On Thu, Jul 18, 2013 at 06:06:44PM -0700, Linda Sun wrote:
> Signed-off-by: Linda Sun <lsun at vmware.com>

I folded in the following incremental to fix up a few style issues,
and then applied this to master.

Thanks,

Ben.

diff --git a/lib/odp-util.c b/lib/odp-util.c
index c12e2fe..5a32221 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -143,10 +143,10 @@ format_generic_odp_action(struct ds *ds, const struct nlattr *a)
 static void
 format_odp_sample_action(struct ds *ds, const struct nlattr *attr)
 {
-    static const struct nl_policy ovs_sample_policy[__OVS_SAMPLE_ATTR_MAX] = {
-        { NL_A_NO_ATTR, 0, 0, false},    /* OVS_SAMPLE_ATTR_UNSPEC */
-        { NL_A_U32, 0, 0, false},        /* OVS_SAMPLE_ATTR_PROBABILITY */
-        { NL_A_NESTED, 0, 0, false},     /* OVS_SAMPLE_ATTR_ACTIONS */
+    static const struct nl_policy ovs_sample_policy[] = {
+        { NL_A_NO_ATTR, 0, 0, false }, /* OVS_SAMPLE_ATTR_UNSPEC */
+        { NL_A_U32, 0, 0, false },     /* OVS_SAMPLE_ATTR_PROBABILITY */
+        { NL_A_NESTED, 0, 0, false },  /* OVS_SAMPLE_ATTR_ACTIONS */
     };
     struct nlattr *a[ARRAY_SIZE(ovs_sample_policy)];
     double percentage;
@@ -259,10 +259,10 @@ parse_flags(const char *s, const char *(*bit_to_string)(uint32_t),
 static void
 format_odp_userspace_action(struct ds *ds, const struct nlattr *attr)
 {
-    static const struct nl_policy ovs_userspace_policy[__OVS_USERSPACE_ATTR_MAX] = {
-        { NL_A_NO_ATTR, 0, 0, false},   /* OVS_USERSPACE_ATTR_UNSPEC */
-        { NL_A_U32, 0, 0, false},       /* OVS_USERSPACE_ATTR_PID */
-        { NL_A_UNSPEC, 0, 0, true},     /* OVS_USERSPACE_ATTR_USERDATA */
+    static const struct nl_policy ovs_userspace_policy[] = {
+        { NL_A_NO_ATTR, 0, 0, false }, /* OVS_USERSPACE_ATTR_UNSPEC */
+        { NL_A_U32, 0, 0, false },     /* OVS_USERSPACE_ATTR_PID */
+        { NL_A_UNSPEC, 0, 0, true },   /* OVS_USERSPACE_ATTR_USERDATA */
     };
     struct nlattr *a[ARRAY_SIZE(ovs_userspace_policy)];
     const struct nlattr *userdata_attr;




More information about the dev mailing list