diff mbox series

[ovs-dev] Fix travis CI compilation issue for OSX job

Message ID 20200124095310.1229218-1-numans@ovn.org
State Not Applicable
Headers show
Series [ovs-dev] Fix travis CI compilation issue for OSX job | expand

Commit Message

Numan Siddique Jan. 24, 2020, 9:53 a.m. UTC
From: Numan Siddique <numans@ovn.org>

After the commit [1], the job fails with the below compilation error

*****
lib/actions.c:1187:38: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
        ds_put_format(s, "=%"PRIu16, dst->weight ? dst->weight : 100);
                           ~~        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/actions.c:1211:47: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
                      ",actions=", bucket_id, dst->weight ? dst->weight : 100);
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make[1]: *** [lib/actions.lo] Error 1
*********

This patch fixes this issue.

[1] - 85b3544aabb2("ovn-controller: A new action "select".)

Fixes: 85b3544aabb2("ovn-controller: A new action "select".)
CC: Han Zhou <hzhou@ovn.org>
Signed-off-by: Numan Siddique <numans@ovn.org>
---
 lib/actions.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

0-day Robot Jan. 24, 2020, 9:56 a.m. UTC | #1
Bleep bloop.  Greetings Numan Siddique, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
fatal: sha1 information is lacking or useless (lib/actions.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Fix travis CI compilation issue for OSX job
The copy of the patch that failed is found in:
   /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/lib/actions.c b/lib/actions.c
index a0f6aeb81..f22acddff 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1150,6 +1150,11 @@  parse_select_action(struct action_context *ctx, struct expr_field *res_field)
                 lexer_syntax_error(ctx->lexer, "weight can't be 0");
             }
         }
+
+        if (dst.weight == 0) {
+            dst.weight = 100;
+        }
+
         lexer_match(ctx->lexer, LEX_T_COMMA);
 
         /* Append to dsts. */
@@ -1184,7 +1189,7 @@  format_SELECT(const struct ovnact_select *select, struct ds *s)
 
         const struct ovnact_select_dst *dst = &select->dsts[i];
         ds_put_format(s, "%"PRIu16, dst->id);
-        ds_put_format(s, "=%"PRIu16, dst->weight ? dst->weight : 100);
+        ds_put_format(s, "=%"PRIu16, dst->weight);
     }
     ds_put_char(s, ')');
     ds_put_char(s, ';');
@@ -1208,7 +1213,7 @@  encode_SELECT(const struct ovnact_select *select,
     for (size_t bucket_id = 0; bucket_id < select->n_dsts; bucket_id++) {
         const struct ovnact_select_dst *dst = &select->dsts[bucket_id];
         ds_put_format(&ds, ",bucket=bucket_id=%"PRIuSIZE",weight:%"PRIu16
-                      ",actions=", bucket_id, dst->weight ? dst->weight : 100);
+                      ",actions=", bucket_id, dst->weight);
         ds_put_format(&ds, "load:%u->%s[%u..%u],", dst->id, sf.field->name,
                       sf.ofs, sf.ofs + sf.n_bits - 1);
         ds_put_format(&ds, "resubmit(,%d)", resubmit_table);