From patchwork Fri Jan 24 09:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1228726 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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483vbZ0s1Sz9sRd for ; Fri, 24 Jan 2020 20:53:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7934288396; Fri, 24 Jan 2020 09:53:28 +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 i5YsOeWuT+lz; Fri, 24 Jan 2020 09:53:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 6AB968836B; Fri, 24 Jan 2020 09:53:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3B6ABC1D80; Fri, 24 Jan 2020 09:53:27 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 88507C0174 for ; Fri, 24 Jan 2020 09:53:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 70E9420366 for ; Fri, 24 Jan 2020 09:53: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 57lvz006HHPp for ; Fri, 24 Jan 2020 09:53:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by silver.osuosl.org (Postfix) with ESMTPS id 3084C20108 for ; Fri, 24 Jan 2020 09:53:24 +0000 (UTC) X-Originating-IP: 27.7.144.66 Received: from nummac.local (unknown [27.7.144.66]) (Authenticated sender: numans@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 462724001A; Fri, 24 Jan 2020 09:53:19 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Fri, 24 Jan 2020 15:23:10 +0530 Message-Id: <20200124095310.1229218-1-numans@ovn.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Cc: Han Zhou Subject: [ovs-dev] [PATCH] 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);