ovs-vsctl: Simplify code.
authorAlex Wang <alexw@nicira.com>
Wed, 10 Jun 2015 22:31:51 +0000 (15:31 -0700)
committerAlex Wang <alexw@nicira.com>
Tue, 23 Jun 2015 16:43:23 +0000 (09:43 -0700)
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
utilities/ovs-vsctl.c

index 009a8ca..e800f6f 100644 (file)
@@ -2544,9 +2544,8 @@ cmd_get_manager(struct vsctl_context *ctx)
 }
 
 static void
-delete_managers(const struct vsctl_context *ctx)
+delete_managers(const struct ovsrec_open_vswitch *ovs)
 {
-    const struct ovsrec_open_vswitch *ovs = ctx->ovs;
     size_t i;
 
     /* Delete Manager rows pointed to by 'manager_options' column. */
@@ -2564,7 +2563,7 @@ cmd_del_manager(struct vsctl_context *ctx)
     const struct ovsrec_open_vswitch *ovs = ctx->ovs;
 
     verify_managers(ovs);
-    delete_managers(ctx);
+    delete_managers(ovs);
 }
 
 static void
@@ -2594,7 +2593,7 @@ cmd_set_manager(struct vsctl_context *ctx)
     const size_t n = ctx->argc - 1;
 
     verify_managers(ctx->ovs);
-    delete_managers(ctx);
+    delete_managers(ctx->ovs);
     insert_managers(ctx, &ctx->argv[1], n);
 }