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

Alex Wang alexw at nicira.com
Fri Jul 19 17:35:20 UTC 2013


Hey,

Then, should we also change the "-Wno-override-init" to "-Woverride-init"?

I also had related warning when compiling with clang. And these two patches
fix it.

Kind Regards,
Alex Wang,

On Fri, Jul 19, 2013 at 10:09 AM, Ben Pfaff <blp at nicira.com> wrote:

> 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;
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130719/2a1e5349/attachment-0003.html>


More information about the dev mailing list