[ovs-dev] [PATCH 7/7] ovsdb: Fix dead assignment reported by clang.

Ben Pfaff blp at ovn.org
Sun Jul 3 04:30:46 UTC 2016


On Tue, Jun 28, 2016 at 10:02:28PM -0700, William Tu wrote:
> Clang reports variable 'error' never been used.  Fix by
> returning error when table_update->type != JSON_OBJECT.
> 
> Signed-off-by: William Tu <u9012063 at gmail.com>

Thanks, applied, except that I changed this to simplify the code
slightly:

--8<--------------------------cut here-------------------------->8--

From: William Tu <u9012063 at gmail.com>
Date: Tue, 28 Jun 2016 22:02:28 -0700
Subject: [PATCH] ovsdb: Fix dead assignment reported by clang.

Clang reports variable 'error' never been used.  Fix by
returning error when table_update->type != JSON_OBJECT.

Signed-off-by: William Tu <u9012063 at gmail.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 ovsdb/replication.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ovsdb/replication.c b/ovsdb/replication.c
index 3d1bc33..a267a3a 100644
--- a/ovsdb/replication.c
+++ b/ovsdb/replication.c
@@ -468,8 +468,8 @@ process_table_update(struct json *table_update, const char *table_name,
     struct ovsdb_error *error;
 
     if (table_update->type != JSON_OBJECT) {
-        error = ovsdb_error("Not a JSON object",
-                            "<table-update> for table is not object");
+        return ovsdb_error("Not a JSON object",
+                           "<table-update> for table is not object");
     }
 
     table = ovsdb_get_table(database, table_name);
-- 
2.1.3




More information about the dev mailing list