From patchwork Mon Apr 17 17:07:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 97511 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1426455qgf; Mon, 17 Apr 2017 10:07:57 -0700 (PDT) X-Received: by 10.200.42.199 with SMTP id c7mr4723606qta.102.1492448877671; Mon, 17 Apr 2017 10:07:57 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id s41si11465892qtg.168.2017.04.17.10.07.57; Mon, 17 Apr 2017 10:07:57 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id F216D63512; Mon, 17 Apr 2017 17:07:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D38E36350B; Mon, 17 Apr 2017 17:07:54 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id DF0606350A; Mon, 17 Apr 2017 17:07:53 +0000 (UTC) Received: from mail-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by lists.linaro.org (Postfix) with ESMTPS id BDDD26350A for ; Mon, 17 Apr 2017 17:07:51 +0000 (UTC) Received: by mail-oi0-f53.google.com with SMTP id x184so60710967oia.1 for ; Mon, 17 Apr 2017 10:07:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vgkxZ0dV8Vr8HpPeZQRrR9+PK+d07Sda7iT985eK8YE=; b=rvKvTpIam/eLY4GhrHn1woSTgObDOB/QAXqWBk0lIMcz9a0zD9PyUGgDFSQvNhs79w lSVf4DDSwBbC7PvkQU1VBDXsG2HkW810Ipz/UcMYt2D8kaQvgG0Ck/73RgRLdhjHGJcZ f1eWAoo+dvAtHj59VbGA/rLI1SfVMZOF/dSMFs9IJzRWm17h7rB4cAxQW4DHAPdV76CO mKfGETpBKNbKT2ipa7g/YNJEByAa05UZ866WrX8JYx+ExHUXsqCOEMZv5Yud+3PGGbx8 //BbkXb7LBFzcn4huexwP8DF8Dqa/+GJcYCbjOQfGUDK1/naym8NGdOrWm+Y5mKnBbNj vtFA== X-Gm-Message-State: AN3rC/5Q1QSjea6SVSlNKw972p/kmoAI8CN5xAwwXnyQrRTwkN3oHdEF G8xdl1OWWkjVJ3+nNLI= X-Received: by 10.157.10.66 with SMTP id 60mr5318205otg.114.1492448871164; Mon, 17 Apr 2017 10:07:51 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id g188sm4960779oic.23.2017.04.17.10.07.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Apr 2017 10:07:50 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Mon, 17 Apr 2017 12:07:45 -0500 Message-Id: <20170417170745.3528-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [lng-odp] [PATCH] bug: linux-generic: add syntax to allow newer clang to compile odp X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2942 by adding casts needed to avoid compilation failures when using clang 4.0.0 included in Ubuntu 17.04, which is stricter than clang 3.8.1 which is in Ubuntu 16.10. Signed-off-by: Bill Fischofer --- helper/chksum.c | 6 +++--- platform/linux-generic/odp_packet_flags.c | 2 +- .../validation/api/classification/odp_classification_common.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) -- 2.11.0 diff --git a/helper/chksum.c b/helper/chksum.c index f740618d..ae70d97e 100644 --- a/helper/chksum.c +++ b/helper/chksum.c @@ -128,7 +128,7 @@ static inline int odph_process_l4_hdr(odp_packet_t odp_pkt, * should come from the udp header, unlike for TCP where is * derived. */ l4_len = odp_be_to_cpu_16(udp_hdr_ptr->length); - pkt_chksum_ptr = &udp_hdr_ptr->chksum; + pkt_chksum_ptr = (uint16_t *)(void *)&udp_hdr_ptr->chksum; pkt_chksum_offset = l4_offset + offsetof(odph_udphdr_t, chksum); } else if (odp_packet_has_tcp(odp_pkt)) { tcp_hdr_ptr = (odph_tcphdr_t *)l4_ptr; @@ -139,7 +139,7 @@ static inline int odph_process_l4_hdr(odp_packet_t odp_pkt, ODPH_TCPHDR_LEN, tcp_hdr_ptr); } - pkt_chksum_ptr = &tcp_hdr_ptr->cksm; + pkt_chksum_ptr = (uint16_t *)(void *)&tcp_hdr_ptr->cksm; pkt_chksum_offset = l4_offset + offsetof(odph_tcphdr_t, cksm); is_tcp = true; } else { @@ -203,7 +203,7 @@ static inline int odph_process_l3_hdr(odp_packet_t odp_pkt, ipv4_hdr_ptr = &ipv4_hdr; } - addrs_ptr = (uint16_t *)&ipv4_hdr_ptr->src_addr; + addrs_ptr = (uint16_t *)(void *)&ipv4_hdr_ptr->src_addr; addrs_len = 2 * ODPH_IPV4ADDR_LEN; protocol = ipv4_hdr_ptr->proto; l3_len = odp_be_to_cpu_16(ipv4_hdr_ptr->tot_len); diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ea9a2271..a23fdd81 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -180,7 +180,7 @@ odp_bool_t odp_packet_drop_eligible(odp_packet_t pkt) void odp_packet_drop_eligible_set(odp_packet_t pkt, odp_bool_t drop) { - setflag(pkt, input_flags.nodrop, !drop, LAYER_ALL); + setflag(pkt, input_flags.nodrop, (!drop), LAYER_ALL); } int8_t odp_packet_shaper_len_adjust(odp_packet_t pkt) diff --git a/test/common_plat/validation/api/classification/odp_classification_common.c b/test/common_plat/validation/api/classification/odp_classification_common.c index 3b379c14..eca30b87 100644 --- a/test/common_plat/validation/api/classification/odp_classification_common.c +++ b/test/common_plat/validation/api/classification/odp_classification_common.c @@ -278,14 +278,14 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) ethhdr = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); memcpy(ethhdr->src.addr, &src_mac, ODPH_ETHADDR_LEN); memcpy(ethhdr->dst.addr, &dst_mac_be, ODPH_ETHADDR_LEN); - vlan_type = (odp_u16be_t *)ðhdr->type; + vlan_type = (odp_u16be_t *)(void *)ðhdr->type; vlan_hdr = (odph_vlanhdr_t *)(ethhdr + 1); if (pkt_info.vlan_qinq) { odp_packet_has_vlan_qinq_set(pkt, 1); *vlan_type = odp_cpu_to_be_16(ODPH_ETHTYPE_VLAN_OUTER); vlan_hdr->tci = odp_cpu_to_be_16(0); - vlan_type = (uint16_t *)&vlan_hdr->type; + vlan_type = (uint16_t *)(void *)&vlan_hdr->type; vlan_hdr++; } if (pkt_info.vlan) {