[ovs-dev] [PATCH 1/8] ovsdb: Remove unused ovsdb_datum_from_json_unique().

Ben Pfaff blp at nicira.com
Mon Aug 23 19:19:50 UTC 2010


This function was not used outside of the test-ovsdb program.  It seems
like we might as well remove it.
---
 lib/ovsdb-data.c   |   17 -----------------
 lib/ovsdb-data.h   |    5 -----
 tests/test-ovsdb.c |   10 ----------
 3 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index dba89ac..9c54fe8 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -1214,23 +1214,6 @@ ovsdb_datum_from_json(struct ovsdb_datum *datum,
     return error;
 }
 
-/* This is the same as ovsdb_datum_from_json(), except that duplicate values
- * in a set or map are dropped instead of being treated as an error. */
-struct ovsdb_error *
-ovsdb_datum_from_json_unique(struct ovsdb_datum *datum,
-                             const struct ovsdb_type *type,
-                             const struct json *json,
-                             struct ovsdb_symbol_table *symtab)
-{
-    struct ovsdb_error *error;
-
-    error = ovsdb_datum_from_json__(datum, type, json, symtab);
-    if (!error) {
-        ovsdb_datum_sort_unique(datum, type->key.type, type->value.type);
-    }
-    return error;
-}
-
 /* Converts 'datum', of the specified 'type', to JSON format, and returns the
  * JSON.  The caller is responsible for freeing the returned JSON.
  *
diff --git a/lib/ovsdb-data.h b/lib/ovsdb-data.h
index 820a4db..ae0faa2 100644
--- a/lib/ovsdb-data.h
+++ b/lib/ovsdb-data.h
@@ -84,11 +84,6 @@ struct ovsdb_error *ovsdb_atom_from_json(union ovsdb_atom *,
                                          const struct json *,
                                          struct ovsdb_symbol_table *)
     WARN_UNUSED_RESULT;
-struct ovsdb_error *ovsdb_datum_from_json_unique(struct ovsdb_datum *,
-                                                 const struct ovsdb_type *,
-                                                 const struct json *,
-                                                 struct ovsdb_symbol_table *)
-    WARN_UNUSED_RESULT;
 struct json *ovsdb_atom_to_json(const union ovsdb_atom *,
                                 enum ovsdb_atomic_type);
 
diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index f516f9d..18784a5 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -137,9 +137,6 @@ usage(void)
            "    print JSON ATOMs in sorted order\n"
            "  parse-data TYPE DATUM...\n"
            "    parse JSON DATUMs as data of given TYPE, and re-serialize\n"
-           "  parse-data-unique TYPE DATUM...\n"
-           "    parse JSON DATUMs as data of given TYPE, eliminating\n"
-           "    duplicate keys, and re-serialize\n"
            "  parse-data-strings TYPE DATUM...\n"
            "    parse string DATUMs as data of given TYPE, and re-serialize\n"
            "  parse-column NAME OBJECT\n"
@@ -515,12 +512,6 @@ do_parse_data(int argc, char *argv[])
 }
 
 static void
-do_parse_data_unique(int argc, char *argv[])
-{
-    do_parse_data__(argc, argv, ovsdb_datum_from_json_unique);
-}
-
-static void
 do_parse_data_strings(int argc, char *argv[])
 {
     struct ovsdb_type type;
@@ -1908,7 +1899,6 @@ static struct command all_commands[] = {
     { "parse-atoms", 2, INT_MAX, do_parse_atoms },
     { "parse-atom-strings", 2, INT_MAX, do_parse_atom_strings },
     { "parse-data", 2, INT_MAX, do_parse_data },
-    { "parse-data-unique", 2, INT_MAX, do_parse_data_unique },
     { "parse-data-strings", 2, INT_MAX, do_parse_data_strings },
     { "sort-atoms", 2, 2, do_sort_atoms },
     { "parse-column", 2, 2, do_parse_column },
-- 
1.7.1





More information about the dev mailing list