From patchwork Wed Dec 10 21:49:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 42101 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4F8C126C75 for ; Wed, 10 Dec 2014 21:50:14 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf2535554lab.9 for ; Wed, 10 Dec 2014 13:50:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state: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=Y1v6a1BaBguHkiw1cHTn603tppTIE2d48bxitH9K51Y=; b=ktMAd+Y9PEPoPg+x90lfLAyK6ZD2DH1JyyJoUNsXD6p9eDHBe6wS18JVeFvi/lhDQ0 Ghgxy58NHsep1y3rKGrcxlE9oLfaodNKVVgySDv/bQJFGzrrnNq3IJsBIkzclbFTMf6j 6KMNYYFzrrN7JoOebH1nak3ieR7JGk4jEUZwlnCxIl/80UVshhl/Vo7XJA2UJ5fuGoCr FnmZomvlrLlQLVZkiCBr7a6OGABKNVWobp10IfcgQQVx7TOKCN9OBVZwtKm+tenFyoZb RRkhDswpGcJSXKP52udkg1j1dcF1V1LObBl2SRkU5ayT7cyca0i2La8wL2sDx5kXHZID KYQA== X-Gm-Message-State: ALoCoQnl0wN+RGs8Umni+B8BP2uQj5yzgmqwzCfJacrDsDLxb2L27/f3UyZ7iXo1iM8XCJt1bdhV X-Received: by 10.181.27.135 with SMTP id jg7mr1906967wid.5.1418248213311; Wed, 10 Dec 2014 13:50:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.5 with SMTP id r5ls177834lae.47.gmail; Wed, 10 Dec 2014 13:50:12 -0800 (PST) X-Received: by 10.112.55.7 with SMTP id n7mr6152943lbp.49.1418248212954; Wed, 10 Dec 2014 13:50:12 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ob7si5849612lbb.127.2014.12.10.13.50.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Dec 2014 13:50:12 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so3169840lab.22 for ; Wed, 10 Dec 2014 13:50:12 -0800 (PST) X-Received: by 10.112.130.132 with SMTP id oe4mr6301800lbb.82.1418248212858; Wed, 10 Dec 2014 13:50:12 -0800 (PST) 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.142.69 with SMTP id ru5csp336019lbb; Wed, 10 Dec 2014 13:50:11 -0800 (PST) X-Received: by 10.224.80.67 with SMTP id s3mr12211403qak.84.1418248210858; Wed, 10 Dec 2014 13:50:10 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id h34si1868324qgf.2.2014.12.10.13.50.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Dec 2014 13:50:10 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xyp95-000264-JA; Wed, 10 Dec 2014 21:50:07 +0000 Received: from mail-qa0-f51.google.com ([209.85.216.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xyp8y-00024R-7A for lng-odp@lists.linaro.org; Wed, 10 Dec 2014 21:50:00 +0000 Received: by mail-qa0-f51.google.com with SMTP id k15so2633585qaq.24 for ; Wed, 10 Dec 2014 13:49:55 -0800 (PST) X-Received: by 10.224.22.196 with SMTP id o4mr12963706qab.85.1418248194940; Wed, 10 Dec 2014 13:49:54 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id l48sm5404781qgd.38.2014.12.10.13.49.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Dec 2014 13:49:54 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 10 Dec 2014 16:49:46 -0500 Message-Id: <1418248186-46978-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] api: rename ODP_STATIC_ASSERT to _ODP_STATIC_ASSERT X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@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.215.49 as permitted sender) smtp.mail=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 This assert is used in the public API but is not intended for use in applications and so it is marked with an underscore. Signed-off-by: Mike Holmes --- The checkpatch warning for camel case cannot be avoided, the offending function is defined externally to ODP. #145: FILE: platform/linux-generic/include/api/odp_debug.h:48: +#define _ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg helper/include/odph_eth.h | 6 +++--- helper/include/odph_icmp.h | 2 +- helper/include/odph_ip.h | 4 ++-- helper/include/odph_ipsec.h | 6 +++--- helper/include/odph_udp.h | 2 +- platform/linux-generic/include/api/odp_debug.h | 2 +- platform/linux-generic/include/odp_buffer_internal.h | 3 ++- platform/linux-generic/include/odp_packet_internal.h | 18 +++++++++++------- platform/linux-generic/include/odp_packet_io_queue.h | 4 ++-- platform/linux-generic/include/odp_packet_socket.h | 4 ++-- platform/linux-generic/include/odp_timer_internal.h | 10 +++++----- platform/linux-generic/odp_buffer_pool.c | 4 ++-- platform/linux-generic/odp_schedule.c | 3 ++- 13 files changed, 37 insertions(+), 31 deletions(-) diff --git a/helper/include/odph_eth.h b/helper/include/odph_eth.h index 065a94b..6a29b76 100644 --- a/helper/include/odph_eth.h +++ b/helper/include/odph_eth.h @@ -39,7 +39,7 @@ typedef struct ODP_PACKED { } odph_ethaddr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, "ODPH_ETHADDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, "ODPH_ETHADDR_T__SIZE_ERROR"); /** * Ethernet header @@ -51,7 +51,7 @@ typedef struct ODP_PACKED { } odph_ethhdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, "ODPH_ETHHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, "ODPH_ETHHDR_T__SIZE_ERROR"); /** * VLAN header @@ -64,7 +64,7 @@ typedef struct ODP_PACKED { } odph_vlanhdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_vlanhdr_t) == ODPH_VLANHDR_LEN, "ODPH_VLANHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_vlanhdr_t) == ODPH_VLANHDR_LEN, "ODPH_VLANHDR_T__SIZE_ERROR"); /* Ethernet header Ether Type ('type') values, a selected few */ diff --git a/helper/include/odph_icmp.h b/helper/include/odph_icmp.h index 8533fb5..bc97008 100644 --- a/helper/include/odph_icmp.h +++ b/helper/include/odph_icmp.h @@ -90,7 +90,7 @@ typedef struct ODP_PACKED { exceeded*/ /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN, "ODPH_ICMPHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN, "ODPH_ICMPHDR_T__SIZE_ERROR"); #ifdef __cplusplus } diff --git a/helper/include/odph_ip.h b/helper/include/odph_ip.h index f78724e..5b803a0 100644 --- a/helper/include/odph_ip.h +++ b/helper/include/odph_ip.h @@ -68,7 +68,7 @@ typedef struct ODP_PACKED { } odph_ipv4hdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN, "ODPH_IPV4HDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN, "ODPH_IPV4HDR_T__SIZE_ERROR"); /** * Check if IPv4 checksum is valid @@ -141,7 +141,7 @@ typedef struct ODP_PACKED { } odph_ipv6hdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ipv6hdr_t) == ODPH_IPV6HDR_LEN, "ODPH_IPV6HDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_ipv6hdr_t) == ODPH_IPV6HDR_LEN, "ODPH_IPV6HDR_T__SIZE_ERROR"); /** @name * IP protocol values (IPv4:'proto' or IPv6:'next_hdr') diff --git a/helper/include/odph_ipsec.h b/helper/include/odph_ipsec.h index c58a1c8..fd72bc6 100644 --- a/helper/include/odph_ipsec.h +++ b/helper/include/odph_ipsec.h @@ -37,7 +37,7 @@ typedef struct ODP_PACKED { } odph_esphdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN, "ODPH_ESPHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN, "ODPH_ESPHDR_T__SIZE_ERROR"); /** * IPSec ESP trailer @@ -49,7 +49,7 @@ typedef struct ODP_PACKED { } odph_esptrl_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN, "ODPH_ESPTRL_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN, "ODPH_ESPTRL_T__SIZE_ERROR"); /** * IPSec AH header @@ -64,7 +64,7 @@ typedef struct ODP_PACKED { } odph_ahhdr_t; /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN, "ODPH_AHHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN, "ODPH_AHHDR_T__SIZE_ERROR"); #ifdef __cplusplus } diff --git a/helper/include/odph_udp.h b/helper/include/odph_udp.h index b2eaf03..6fac3a6 100644 --- a/helper/include/odph_udp.h +++ b/helper/include/odph_udp.h @@ -93,7 +93,7 @@ static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt) } /** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_udphdr_t) == ODPH_UDPHDR_LEN, "ODPH_UDPHDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(odph_udphdr_t) == ODPH_UDPHDR_LEN, "ODPH_UDPHDR_T__SIZE_ERROR"); #ifdef __cplusplus } diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h index f5e6821..a4ce1d9 100644 --- a/platform/linux-generic/include/api/odp_debug.h +++ b/platform/linux-generic/include/api/odp_debug.h @@ -45,7 +45,7 @@ extern "C" { * Compile time assertion-macro - fail compilation if cond is false. * @note This macro has zero runtime overhead */ -#define ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) +#define _ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) /** * ODP log level. diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 0027bfc..32b8d42 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -96,7 +96,8 @@ typedef struct odp_buffer_hdr_t { } odp_buffer_hdr_t; /* Ensure next header starts from 8 byte align */ -ODP_STATIC_ASSERT((sizeof(odp_buffer_hdr_t) % 8) == 0, "ODP_BUFFER_HDR_T__SIZE_ERROR"); +_ODP_STATIC_ASSERT((sizeof(odp_buffer_hdr_t) % 8) == 0, + "ODP_BUFFER_HDR_T__SIZE_ERROR"); /* Raw buffer header */ diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 49c59b2..af9b3a0 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -58,7 +58,8 @@ typedef union { }; } input_flags_t; -ODP_STATIC_ASSERT(sizeof(input_flags_t) == sizeof(uint32_t), "INPUT_FLAGS_SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(input_flags_t) == sizeof(uint32_t), + "INPUT_FLAGS_SIZE_ERROR"); /** * Packet error flags @@ -77,7 +78,8 @@ typedef union { }; } error_flags_t; -ODP_STATIC_ASSERT(sizeof(error_flags_t) == sizeof(uint32_t), "ERROR_FLAGS_SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(error_flags_t) == sizeof(uint32_t), + "ERROR_FLAGS_SIZE_ERROR"); /** * Packet output flags @@ -92,7 +94,8 @@ typedef union { }; } output_flags_t; -ODP_STATIC_ASSERT(sizeof(output_flags_t) == sizeof(uint32_t), "OUTPUT_FLAGS_SIZE_ERROR"); +_ODP_STATIC_ASSERT(sizeof(output_flags_t) == sizeof(uint32_t), + "OUTPUT_FLAGS_SIZE_ERROR"); /** * Internal Packet header @@ -120,10 +123,11 @@ typedef struct { uint8_t buf_data[]; /* start of buffer data area */ } odp_packet_hdr_t; -ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) == ODP_OFFSETOF(odp_packet_hdr_t, buf_data), - "ODP_PACKET_HDR_T__SIZE_ERR"); -ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) % sizeof(uint64_t) == 0, - "ODP_PACKET_HDR_T__SIZE_ERR2"); +_ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) == + ODP_OFFSETOF(odp_packet_hdr_t, buf_data), + "ODP_PACKET_HDR_T__SIZE_ERR"); +_ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) % sizeof(uint64_t) == 0, + "ODP_PACKET_HDR_T__SIZE_ERR2"); /** * Return the packet header diff --git a/platform/linux-generic/include/odp_packet_io_queue.h b/platform/linux-generic/include/odp_packet_io_queue.h index d323a5e..c3b8309 100644 --- a/platform/linux-generic/include/odp_packet_io_queue.h +++ b/platform/linux-generic/include/odp_packet_io_queue.h @@ -24,8 +24,8 @@ extern "C" { /** Max nbr of pkts to receive in one burst (keep same as QUEUE_MULTI_MAX) */ #define ODP_PKTIN_QUEUE_MAX_BURST 16 /* pktin_deq_multi() depends on the condition: */ -ODP_STATIC_ASSERT(ODP_PKTIN_QUEUE_MAX_BURST >= QUEUE_MULTI_MAX, - "ODP_PKTIN_DEQ_MULTI_MAX_ERROR"); +_ODP_STATIC_ASSERT(ODP_PKTIN_QUEUE_MAX_BURST >= QUEUE_MULTI_MAX, + "ODP_PKTIN_DEQ_MULTI_MAX_ERROR"); int pktin_enqueue(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr); odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *queue); diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index 9c1bd78..c4f8af1 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -64,8 +64,8 @@ struct ring { struct tpacket_req req; }; -ODP_STATIC_ASSERT(offsetof(struct ring, mm_space) <= ODP_CACHE_LINE_SIZE, - "ERR_STRUCT_RING"); +_ODP_STATIC_ASSERT(offsetof(struct ring, mm_space) <= ODP_CACHE_LINE_SIZE, + "ERR_STRUCT_RING"); /** Packet socket using mmap rings for both Rx and Tx */ typedef struct { diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h index ad28f53..ae2e8c5 100644 --- a/platform/linux-generic/include/odp_timer_internal.h +++ b/platform/linux-generic/include/odp_timer_internal.h @@ -53,12 +53,12 @@ typedef struct odp_timeout_hdr_t { -ODP_STATIC_ASSERT(sizeof(odp_timeout_hdr_t) == - ODP_OFFSETOF(odp_timeout_hdr_t, buf_data), - "ODP_TIMEOUT_HDR_T__SIZE_ERR"); +_ODP_STATIC_ASSERT(sizeof(odp_timeout_hdr_t) == + ODP_OFFSETOF(odp_timeout_hdr_t, buf_data), + "ODP_TIMEOUT_HDR_T__SIZE_ERR"); -ODP_STATIC_ASSERT(sizeof(odp_timeout_hdr_t) % sizeof(uint64_t) == 0, - "ODP_TIMEOUT_HDR_T__SIZE_ERR2"); +_ODP_STATIC_ASSERT(sizeof(odp_timeout_hdr_t) % sizeof(uint64_t) == 0, + "ODP_TIMEOUT_HDR_T__SIZE_ERR2"); /** diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index d20999b..91ad435 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -47,8 +47,8 @@ union buffer_type_any_u { odp_timeout_hdr_t tmo; }; -ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0, - "BUFFER_TYPE_ANY_U__SIZE_ERR"); +_ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0, + "BUFFER_TYPE_ANY_U__SIZE_ERR"); /* Any buffer type header */ typedef struct { diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 7c09c23..3e66ea8 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -38,7 +38,8 @@ /* Mask of queues per priority */ typedef uint8_t pri_mask_t; -ODP_STATIC_ASSERT((8*sizeof(pri_mask_t)) >= QUEUES_PER_PRIO, "pri_mask_t_is_too_small"); +_ODP_STATIC_ASSERT((8*sizeof(pri_mask_t)) >= QUEUES_PER_PRIO, + "pri_mask_t_is_too_small"); typedef struct {