Skip to content

Commit

Permalink
ofp-print: Fix redundant expression.
Browse files Browse the repository at this point in the history
'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>
  • Loading branch information
joestringer committed Aug 25, 2015
1 parent 2fac5fe commit 6c52e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ofp-print.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c52e6d

Please sign in to comment.