From patchwork Thu Jul 7 01:27:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 71494 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1149030qgy; Wed, 6 Jul 2016 18:27:56 -0700 (PDT) X-Received: by 10.237.33.69 with SMTP id 63mr40068190qtc.45.1467854875976; Wed, 06 Jul 2016 18:27:55 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q1si739750qkf.13.2016.07.06.18.27.55; Wed, 06 Jul 2016 18:27:55 -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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3540668519; Thu, 7 Jul 2016 01:27:55 +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 00B2B68504; Thu, 7 Jul 2016 01:27:51 +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 584E168514; Thu, 7 Jul 2016 01:27:48 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.linaro.org (Postfix) with ESMTPS id 25DD0684A4 for ; Thu, 7 Jul 2016 01:27:47 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id u201so5030501oie.0 for ; Wed, 06 Jul 2016 18:27:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=leqVe0q6kVcQxwLPc23VjYPfQBAqxfRL+765dBsZOCE=; b=QxoCA5AFv2vI0pot4+mkme+lKAQgQSn1TRL+8Vz3FjpKkfc8nYM2n2YhQ4/on4+txn YVjjn+R7BZEPJD8if40v9cwiVAycAxnuUvbgl+McjPNoHxnP92YV97mWAmVIuXrXVGjD O0jM38Jv2zNE/BAjb2Toi3amSH0HqNzTO/K9OsQQHVJdihdFvbtuXf4523JGIEalAK6E /GvwIXbE+XkuBIsR4W5MCoczpT3EW4DEs3u/MuIuebT0HBEgKbRSLH2AoSgtPrOvLtE+ CsvvJFsyt6lFfcwN55TPEq7OReRDXNfniqw2CXZtC3FfWE7FZEaLvDHndsYpzIa61mMa mFKw== X-Gm-Message-State: ALyK8tKYiigPj16it8giTPmfTiAEGi2RCeSUgipjr0EuRAQ6PCQP6dXk6TSfoQVVefWXYX5sydo= X-Received: by 10.157.53.50 with SMTP id o47mr12988165otc.189.1467854866630; Wed, 06 Jul 2016 18:27:46 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id j90sm3169331otc.13.2016.07.06.18.27.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jul 2016 18:27:46 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 6 Jul 2016 20:27:44 -0500 Message-Id: <1467854864-565-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic: byteorder: avoid bitfield order doxygen omissions 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=2402 by assigning explicit values to ODP_LITTLE_ENDIAN_BITFIELD and ODP_BIT_ENDIAN_BITFIELD to avoid Doxygen warnings. This makes these consistent with the usage for ODP_BIG_ENDIAN and ODP_LITTLE_ENDIAN. Note that this requires tests of these fields to change from #ifdef to #if. Signed-off-by: Bill Fischofer --- helper/include/odp/helper/tcp.h | 4 ++-- platform/linux-generic/include/odp/api/plat/byteorder_types.h | 6 ++++-- platform/linux-generic/include/protocols/tcp.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h index cabef90..fd234e5 100644 --- a/helper/include/odp/helper/tcp.h +++ b/helper/include/odp/helper/tcp.h @@ -34,7 +34,7 @@ typedef struct ODP_PACKED { odp_u32be_t ack_no; /**< Acknowledgment number */ union { odp_u16be_t doffset_flags; -#if defined(ODP_BIG_ENDIAN_BITFIELD) +#if ODP_BIG_ENDIAN_BITFIELD struct { odp_u16be_t rsvd1:8; odp_u16be_t flags:8; /**< TCP flags as a byte */ @@ -51,7 +51,7 @@ typedef struct ODP_PACKED { odp_u16be_t syn:1; odp_u16be_t fin:1; }; -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD) +#elif ODP_LITTLE_ENDIAN_BITFIELD struct { odp_u16be_t flags:8; odp_u16be_t rsvd1:8; /**< TCP flags as a byte */ diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h b/platform/linux-generic/include/odp/api/plat/byteorder_types.h index 679d4cf..acc899a 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_types.h @@ -52,12 +52,14 @@ extern "C" { #define ODP_LITTLE_ENDIAN 1 #define ODP_BIG_ENDIAN 0 #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN - #define ODP_LITTLE_ENDIAN_BITFIELD + #define ODP_LITTLE_ENDIAN_BITFIELD 1 + #define ODP_BIG_ENDIAN_BITFIELD 0 #else #define ODP_LITTLE_ENDIAN 0 #define ODP_BIG_ENDIAN 1 #define ODP_BYTE_ORDER ODP_BIG_ENDIAN - #define ODP_BIG_ENDIAN_BITFIELD + #define ODP_LITTLE_ENDIAN_BITFIELD 0 + #define ODP_BIG_ENDIAN_BITFIELD 1 #endif typedef uint16_t __odp_bitwise odp_u16le_t; diff --git a/platform/linux-generic/include/protocols/tcp.h b/platform/linux-generic/include/protocols/tcp.h index 4e92e4b..114262e 100644 --- a/platform/linux-generic/include/protocols/tcp.h +++ b/platform/linux-generic/include/protocols/tcp.h @@ -34,7 +34,7 @@ typedef struct ODP_PACKED { odp_u32be_t ack_no; /**< Acknowledgment number */ union { odp_u16be_t doffset_flags; -#if defined(ODP_BIG_ENDIAN_BITFIELD) +#if ODP_BIG_ENDIAN_BITFIELD struct { odp_u16be_t rsvd1:8; odp_u16be_t flags:8; /**< TCP flags as a byte */ @@ -51,7 +51,7 @@ typedef struct ODP_PACKED { odp_u16be_t syn:1; odp_u16be_t fin:1; }; -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD) +#elif ODP_LITTLE_ENDIAN_BITFIELD struct { odp_u16be_t flags:8; odp_u16be_t rsvd1:8; /**< TCP flags as a byte */