Message ID | 20181030214939.17542-1-blp@ovn.org |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev] ovn-northd: Use structure assignment instead of memcpy(). | expand |
On Wed, Oct 31, 2018 at 3:21 AM Ben Pfaff <blp@ovn.org> wrote: > Makes the code easier to read. > > Signed-off-by: Ben Pfaff <blp@ovn.org> > Acked-by: Numan Siddique <nusiddiq@redhat.com> > --- > ovn/northd/ovn-northd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c > index 439651f80308..bc07a40bd0f8 100644 > --- a/ovn/northd/ovn-northd.c > +++ b/ovn/northd/ovn-northd.c > @@ -339,7 +339,7 @@ add_chassis_queue(struct hmap *set, struct uuid > *chassis_uuid, > { > struct ovn_chassis_qdisc_queues *node = xmalloc(sizeof *node); > node->queue_id = queue_id; > - memcpy(&node->chassis_uuid, chassis_uuid, sizeof node->chassis_uuid); > + node->chassis_uuid = *chassis_uuid; > hmap_insert(set, &node->key_node, uuid_hash(chassis_uuid)); > } > > -- > 2.16.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
On Wed, Oct 31, 2018 at 11:17:34PM +0530, Numan Siddique wrote: > On Wed, Oct 31, 2018 at 3:21 AM Ben Pfaff <blp@ovn.org> wrote: > > > Makes the code easier to read. > > > > Signed-off-by: Ben Pfaff <blp@ovn.org> > > > > Acked-by: Numan Siddique <nusiddiq@redhat.com> Thanks, applied to master.
diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 439651f80308..bc07a40bd0f8 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -339,7 +339,7 @@ add_chassis_queue(struct hmap *set, struct uuid *chassis_uuid, { struct ovn_chassis_qdisc_queues *node = xmalloc(sizeof *node); node->queue_id = queue_id; - memcpy(&node->chassis_uuid, chassis_uuid, sizeof node->chassis_uuid); + node->chassis_uuid = *chassis_uuid; hmap_insert(set, &node->key_node, uuid_hash(chassis_uuid)); }
Makes the code easier to read. Signed-off-by: Ben Pfaff <blp@ovn.org> --- ovn/northd/ovn-northd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)