From patchwork Fri Jan 24 09:56:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1228729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483vg01RWWz9sT5 for ; Fri, 24 Jan 2020 20:56:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0A6C12278E; Fri, 24 Jan 2020 09:56:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pF21-lHBYaP6; Fri, 24 Jan 2020 09:56:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id B85CE2011A; Fri, 24 Jan 2020 09:56:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A860EC1D80; Fri, 24 Jan 2020 09:56:24 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9AE4EC0174 for ; Fri, 24 Jan 2020 09:56:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 96D8A8836C for ; Fri, 24 Jan 2020 09:56:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uj46erDA5wqE for ; Fri, 24 Jan 2020 09:56:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by hemlock.osuosl.org (Postfix) with ESMTPS id 8C9938836B for ; Fri, 24 Jan 2020 09:56:22 +0000 (UTC) X-Originating-IP: 27.7.144.66 Received: from nummac.local (unknown [27.7.144.66]) (Authenticated sender: numans@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 857A8FF809; Fri, 24 Jan 2020 09:56:18 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Fri, 24 Jan 2020 15:26:06 +0530 Message-Id: <20200124095606.1229739-1-numans@ovn.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Cc: Han Zhou Subject: [ovs-dev] [PATCH ovn] Fix travis CI compilation issue for OSX job X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Numan Siddique 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 Signed-off-by: Numan Siddique --- lib/actions.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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);