diff mbox series

[ovs-dev] ovsdb-data: Drop redundant initialization from ovsdb_datum_apply_diff().

Message ID 20180925043249.4754-1-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev] ovsdb-data: Drop redundant initialization from ovsdb_datum_apply_diff(). | expand

Commit Message

Ben Pfaff Sept. 25, 2018, 4:32 a.m. UTC
The call to ovsdb_datum_diff() initializes 'new', so it's not necessary to
also do it in ovsdb_datum_apply_diff().

Found by inspection.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/ovsdb-data.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Yifeng Sun Sept. 26, 2018, 5:25 p.m. UTC | #1
Looks good to me, thanks.

Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>

On Mon, Sep 24, 2018 at 9:33 PM Ben Pfaff <blp@ovn.org> wrote:

> The call to ovsdb_datum_diff() initializes 'new', so it's not necessary to
> also do it in ovsdb_datum_apply_diff().
>
> Found by inspection.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---
>  lib/ovsdb-data.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
> index 1e523f29cb87..08b94cafa737 100644
> --- a/lib/ovsdb-data.c
> +++ b/lib/ovsdb-data.c
> @@ -2121,7 +2121,6 @@ ovsdb_datum_apply_diff(struct ovsdb_datum *new,
>                         const struct ovsdb_datum *diff,
>                         const struct ovsdb_type *type)
>  {
> -    ovsdb_datum_init_empty(new);
>      ovsdb_datum_diff(new, old, diff, type);
>
>      /* Make sure member size of 'new' conforms to type. */
> --
> 2.16.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Ben Pfaff Sept. 26, 2018, 8:26 p.m. UTC | #2
Thanks, applied to master.

On Wed, Sep 26, 2018 at 10:25:23AM -0700, Yifeng Sun wrote:
> Looks good to me, thanks.
> 
> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
> 
> On Mon, Sep 24, 2018 at 9:33 PM Ben Pfaff <blp@ovn.org> wrote:
> 
> > The call to ovsdb_datum_diff() initializes 'new', so it's not necessary to
> > also do it in ovsdb_datum_apply_diff().
> >
> > Found by inspection.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > ---
> >  lib/ovsdb-data.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
> > index 1e523f29cb87..08b94cafa737 100644
> > --- a/lib/ovsdb-data.c
> > +++ b/lib/ovsdb-data.c
> > @@ -2121,7 +2121,6 @@ ovsdb_datum_apply_diff(struct ovsdb_datum *new,
> >                         const struct ovsdb_datum *diff,
> >                         const struct ovsdb_type *type)
> >  {
> > -    ovsdb_datum_init_empty(new);
> >      ovsdb_datum_diff(new, old, diff, type);
> >
> >      /* Make sure member size of 'new' conforms to type. */
> > --
> > 2.16.1
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
diff mbox series

Patch

diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index 1e523f29cb87..08b94cafa737 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -2121,7 +2121,6 @@  ovsdb_datum_apply_diff(struct ovsdb_datum *new,
                        const struct ovsdb_datum *diff,
                        const struct ovsdb_type *type)
 {
-    ovsdb_datum_init_empty(new);
     ovsdb_datum_diff(new, old, diff, type);
 
     /* Make sure member size of 'new' conforms to type. */