From patchwork Tue Jul 11 21:48:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 107420 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp5301qge; Tue, 11 Jul 2017 14:48:45 -0700 (PDT) X-Received: by 10.200.34.129 with SMTP id f1mr2719260qta.183.1499809725636; Tue, 11 Jul 2017 14:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499809725; cv=none; d=google.com; s=arc-20160816; b=o+2IRk7LZMF9QbvGs9+q3h76a2zS/grbpHMgTjf58323pjhZdvRMHt2q/9o3jtI11L HcmmDL6+yinONDtQRTKyPgtt9SotXbuGWQ6u2fENktpDXE0/MA146ncNciYdiFQIebco n5ON54PW+pIt7fZxMPxLt6LQF+bdel01ECC4L3ho3MW8AXBd3DquWdrc2vJLSKFNuMMW xya2H1LI/tyv4YNYJYgbDLmsiQSq7MbOTweBKSFj7L0ctdHZGlN+EHdl6/bh8kTCRytP vehx4Ca8CySlAiRhyWd/9IbJh/GlVtDXICo4chx+CRJYeRqmOOQu9pvFTKTcLMQbV0B8 qbWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :delivered-to:arc-authentication-results; bh=EPSq3DqecUXjIEsS2P5OmR88A1kd89fbD7BlLzZurCo=; b=hKXxHLs1LzBCFgpL58BHZmMfS+jhUpalgBtydVxFWMKVOOgKQdX9QohgHdotDh0aro eF0FqnTbAC1B4U3QaJnUt+wIRQcR3JFmqUfySzOxJyYFUilkZfaXywi0vGsTVEtt7ujl uBapkoj3OTqchGLcnFLKHrx1WU4KAXF58NY/Ogl0DfIfk1QF7VOJ8RINoeUPrWpqw5lv 1ykMDZnhPphpZZCb9nx5L1EqsXrN3C9y6C5txlvuEZmcZqNwpAy5Lh99GeZggZ/SsVTg B4T5KZIGOHjV9SgmimzyYNjYIv4sqLBeo34JPp260Ad65M0to5XC2y1tfDC/tYDkWWQt W33Q== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o190si471656qkc.109.2017.07.11.14.48.45; Tue, 11 Jul 2017 14:48:45 -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 1473C64493; Tue, 11 Jul 2017 21:48:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C65DE61BC6; Tue, 11 Jul 2017 21:48:40 +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 EA54562AE3; Tue, 11 Jul 2017 21:48:38 +0000 (UTC) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) by lists.linaro.org (Postfix) with ESMTPS id F222261BC5 for ; Tue, 11 Jul 2017 21:48:37 +0000 (UTC) Received: by mail-oi0-f48.google.com with SMTP id p188so4728928oia.0 for ; Tue, 11 Jul 2017 14:48:37 -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=EPSq3DqecUXjIEsS2P5OmR88A1kd89fbD7BlLzZurCo=; b=cDRoxwk9d5R2gGLZKh5UhhFtQ9l+tEnUjSyX8RTSJLCQq5NU4tk4u5BgdqIApYfWYA AlTszt18i7phfB18vd7VEHoZA/zejDAzc4GHs33jy2+l2roqLTq+G4NRGSpHgpeB4dX5 W/R1NrYYTVFwHrqmFK1UMUrhEjo/mPRg560tENWjXUaCgsk9W+JV8UhESdqvuG7AvdRU zlGgE4gegGJq6E45o44GzIFumZcI8s1iceWRsC/roSSGOTnz6CGEA4R7NXk1Tu68B1o3 0h0PTFb9Pbyi5zZyslEZ3FiotzqR5pleduWWJomm0ZMjaZcqEkXX3Rv9BzlLayooYEk7 kKfA== X-Gm-Message-State: AIVw112gddsrPoGeH68rZ8BkS87lcXkNDi0PvFV5c5DmqydrUiOVr5vs 6ImSvesIxD8naQLlrpFTTAWL X-Received: by 10.202.240.215 with SMTP id o206mr1650459oih.225.1499809717131; Tue, 11 Jul 2017 14:48:37 -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 n189sm718163oih.0.2017.07.11.14.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 14:48:36 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 11 Jul 2017 16:48:33 -0500 Message-Id: <20170711214833.29768-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [MONARCH_LTS 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 +- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.11.0 diff --git a/helper/chksum.c b/helper/chksum.c index 8f188814..772abcd2 100644 --- a/helper/chksum.c +++ b/helper/chksum.c @@ -122,7 +122,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; @@ -133,7 +133,7 @@ static inline int odph_process_l4_hdr(odp_packet_t odp_pkt, tcp_hdr_ptr = &tcp_hdr; } - 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 { @@ -197,7 +197,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 b88324c1..fc0bc1d2 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -18,7 +18,7 @@ odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); \ if (packet_parse_not_complete(pkt_hdr)) \ packet_parse_full(pkt_hdr); \ - pkt_hdr->p.x = v & 1; \ + pkt_hdr->p.x = (v) & 1; \ } while (0) int odp_packet_has_error(odp_packet_t pkt)