ofp-print: Fix redundant expression.
authorJoe Stringer <joestringer@nicira.com>
Wed, 5 Aug 2015 20:31:25 +0000 (13:31 -0700)
committerJoe Stringer <joestringer@nicira.com>
Tue, 25 Aug 2015 00:34:28 +0000 (17:34 -0700)
'features' is always a valid pointer to something on the stack, so
checking (!features || ...) is the same as checking (false || ...).
Simplify the expression.

Found by MIT STACK undefined behaviour checker.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/ofp-print.c

index b8088f3..6e32d4d 100644 (file)
@@ -2754,7 +2754,7 @@ ofp_print_table_features(struct ds *s,
     bool same_stats = prev_stats && table_stats_equal(stats, prev_stats);
     bool same_features = prev_features && table_features_equal(features,
                                                                prev_features);
-    if ((!stats || same_stats) && (!features || same_features)) {
+    if ((!stats || same_stats) && same_features) {
         ds_put_cstr(s, " ditto");
         return;
     }