diff options
author | Ben Pfaff <blp@ovn.org> | 2015-12-04 14:12:05 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-02-19 00:13:39 -0800 |
commit | ce57ea75e674b24209ed66058a88236c31277871 (patch) | |
tree | f268522ab0ea2a5e9c4207bbb357ebee51cb0cf4 /ovn | |
parent | 1d361a815c5632e17f97b00da37804fa55794fc4 (diff) | |
download | openvswitch-ce57ea75e674b24209ed66058a88236c31277871.tar.gz |
expr: Generalize wording of error message in expand_symbol().
The existing wording was very specific to the actual operation being
performed. While this is nice for users, it becomes difficult to maintain
as more and more operations are added. This commit makes the wording less
specific, because a third operation will start using this function in an
upcoming commit.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/lib/expr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c index 0b65492ac..e19692284 100644 --- a/ovn/lib/expr.c +++ b/ovn/lib/expr.c @@ -2625,20 +2625,17 @@ expr_is_normalized(const struct expr *expr) * * If 'rw', verifies that 'f' is a read/write field. * - * 'exchange' should be true if an exchange action is being parsed. This is - * only used to improve error message phrasing. - * * Returns true if successful, false if an error was encountered (in which case * 'ctx->error' reports the particular error). */ static bool -expand_symbol(struct expr_context *ctx, bool rw, bool exchange, +expand_symbol(struct expr_context *ctx, bool rw, struct expr_field *f, struct expr **prereqsp) { const struct expr_symbol *orig_symbol = f->symbol; if (f->symbol->expansion && f->symbol->level != EXPR_L_ORDINAL) { - expr_error(ctx, "Predicate symbol %s cannot be used in %s.", - f->symbol->name, exchange ? "exchange" : "assignment"); + expr_error(ctx, "Predicate symbol %s used where lvalue required.", + f->symbol->name); return false; } @@ -2715,7 +2712,7 @@ parse_assignment(struct expr_context *ctx, const struct simap *ports, goto exit; } const struct expr_symbol *orig_dst = dst.symbol; - if (!expand_symbol(ctx, true, exchange, &dst, &prereqs)) { + if (!expand_symbol(ctx, true, &dst, &prereqs)) { goto exit; } @@ -2725,7 +2722,7 @@ parse_assignment(struct expr_context *ctx, const struct simap *ports, goto exit; } const struct expr_symbol *orig_src = src.symbol; - if (!expand_symbol(ctx, exchange, exchange, &src, &prereqs)) { + if (!expand_symbol(ctx, exchange, &src, &prereqs)) { goto exit; } |