From patchwork Thu Sep 3 19:47:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 53051 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 032D222E23 for ; Thu, 3 Sep 2015 19:48:25 +0000 (UTC) Received: by wicgc1 with SMTP id gc1sf2469wic.3 for ; Thu, 03 Sep 2015 12:48:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=l4j7lWF1BCOgnfJAbtfbS6E46zk0CX90GV4qoBCgDWU=; b=bI2a++g5eLFMJ4kgAN43MRndaRfvS9C6b0Um7XgZryf5fTTeDgzWqpQzG7vQBCZNz0 fadvrOxau5GBQ5n8RlkJRB82MEAuuzK1IklfRDQRR3ckIqWtpHZGEIdqfdkozvY40Sg5 vhsYYE309wrP7JeGTp2n0tcVaFmiPzx1N2e9KSOhEniUnrXbxpD4JgCCUMbJSVD+usjM Vg3oT9IkLjFBVMfbFAicTJHjRRq+S87B4ehP9eqMNjUdR5vG9BZg9ZHTZrE5ShFwP/b2 v2nVznpGAeHd5VhyneSpao6mqy5nTgtNofNh2bQ0jwmAZTTxa/wWuV888datH9sRiue8 D7HQ== X-Gm-Message-State: ALoCoQksSr6b8bualbmXh33sFlxbIfD3zlSFxT8Ar/AucE548YKpdkzI6CFe7+otYuKrWmdXP6cG X-Received: by 10.180.9.104 with SMTP id y8mr87132wia.7.1441309704326; Thu, 03 Sep 2015 12:48:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.226 with SMTP id e2ls234786lah.14.gmail; Thu, 03 Sep 2015 12:48:24 -0700 (PDT) X-Received: by 10.152.5.201 with SMTP id u9mr23944458lau.26.1441309704146; Thu, 03 Sep 2015 12:48:24 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id b1si24076462lbd.146.2015.09.03.12.48.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 12:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcao8 with SMTP id ao8so3960lbc.3 for ; Thu, 03 Sep 2015 12:48:24 -0700 (PDT) X-Received: by 10.112.63.138 with SMTP id g10mr23892680lbs.106.1441309703969; Thu, 03 Sep 2015 12:48:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp1486976lbb; Thu, 3 Sep 2015 12:48:23 -0700 (PDT) X-Received: by 10.140.40.169 with SMTP id x38mr9358076qgx.0.1441309703076; Thu, 03 Sep 2015 12:48:23 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q7si31378713qki.84.2015.09.03.12.48.20; Thu, 03 Sep 2015 12:48:23 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 6065061B7D; Thu, 3 Sep 2015 19:48:20 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 1E4E061B70; Thu, 3 Sep 2015 19:48:15 +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 752A261B73; Thu, 3 Sep 2015 19:48:13 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by lists.linaro.org (Postfix) with ESMTPS id 7DA2D61B1A for ; Thu, 3 Sep 2015 19:48:12 +0000 (UTC) Received: by lbbmp1 with SMTP id mp1so42200lbb.1 for ; Thu, 03 Sep 2015 12:48:11 -0700 (PDT) X-Received: by 10.152.236.39 with SMTP id ur7mr23037180lac.21.1441309691402; Thu, 03 Sep 2015 12:48:11 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id bb8sm6638018lbc.47.2015.09.03.12.48.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Sep 2015 12:48:10 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 3 Sep 2015 22:47:54 +0300 Message-Id: <1441309674-24299-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [NEXT PATCHv2] linux-generic: fix forward declarations for queue and buf X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Fix: In file included from odp_classification.c:15: In file included from ./include/odp_packet_io_internal.h:23: In file included from ./include/odp_classification_datamodel.h:27: ./include/odp_queue_internal.h:92:3: error: redefinition of typedef 'queue_entry_t' is a C11 feature [-Werror,-Wtypedef-redefinition] } queue_entry_t; ^ ./include/odp_buffer_internal.h:107:29: note: previous definition is here typedef union queue_entry_u queue_entry_t; Signed-off-by: Maxim Uvarov --- That patch fixes the same issue as Bills patch. Just post it to mailing list if that solution looks better. v2: put buf typedef to buf header. platform/linux-generic/include/odp/plat/buffer_types.h | 2 ++ platform/linux-generic/include/odp/plat/queue_types.h | 2 ++ platform/linux-generic/include/odp_buffer_internal.h | 10 +++------- platform/linux-generic/include/odp_queue_internal.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/include/odp/plat/buffer_types.h b/platform/linux-generic/include/odp/plat/buffer_types.h index 3203020..0e8fdd9 100644 --- a/platform/linux-generic/include/odp/plat/buffer_types.h +++ b/platform/linux-generic/include/odp/plat/buffer_types.h @@ -29,6 +29,8 @@ typedef ODP_HANDLE_T(odp_buffer_t); /** ODP buffer segment */ typedef ODP_HANDLE_T(odp_buffer_seg_t); +typedef struct odp_buffer_hdr_t odp_buffer_hdr_t; + /** Invalid segment */ #define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)ODP_BUFFER_INVALID) diff --git a/platform/linux-generic/include/odp/plat/queue_types.h b/platform/linux-generic/include/odp/plat/queue_types.h index a7df155..eb2d680 100644 --- a/platform/linux-generic/include/odp/plat/queue_types.h +++ b/platform/linux-generic/include/odp/plat/queue_types.h @@ -36,6 +36,8 @@ typedef ODP_HANDLE_T(odp_queue_group_t); typedef int odp_queue_type_t; +typedef union queue_entry_u queue_entry_t; + #define ODP_QUEUE_TYPE_SCHED 0 #define ODP_QUEUE_TYPE_POLL 1 #define ODP_QUEUE_TYPE_PKTIN 2 diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 6badeba..001654e 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -18,6 +18,7 @@ extern "C" { #endif +#include #include #include #include @@ -101,13 +102,8 @@ typedef union odp_buffer_bits_t { }; } odp_buffer_bits_t; -/* forward declaration */ -struct odp_buffer_hdr_t; -union queue_entry_u; -typedef union queue_entry_u queue_entry_t; - /* Common buffer header */ -typedef struct odp_buffer_hdr_t { +struct odp_buffer_hdr_t { struct odp_buffer_hdr_t *next; /* next buf in a list--keep 1st */ union { /* Multi-use secondary link */ struct odp_buffer_hdr_t *prev; @@ -144,7 +140,7 @@ typedef struct odp_buffer_hdr_t { queue_entry_t *target_qe; /* ordered queue target */ uint64_t sync; /* for ordered synchronization */ }; -} odp_buffer_hdr_t; +}; /** @internal Compile time assert that the * allocator field can handle any allocator id*/ diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h index 0f30965..69f7645 100644 --- a/platform/linux-generic/include/odp_queue_internal.h +++ b/platform/linux-generic/include/odp_queue_internal.h @@ -86,10 +86,10 @@ struct queue_entry_s { odp_atomic_u64_t sync_out; }; -typedef union queue_entry_u { +union queue_entry_u { struct queue_entry_s s; uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct queue_entry_s))]; -} queue_entry_t; +}; queue_entry_t *get_qentry(uint32_t queue_id);