diff mbox

[PATCHv3] linux-generic: remove extraneous ASSERTs

Message ID 1431113516-19863-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit beb3d56189b56fe10e11a7f90656ea918423b489
Headers show

Commit Message

Bill Fischofer May 8, 2015, 7:31 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/include/odp_packet_internal.h | 3 ---
 platform/linux-generic/odp_pool.c                    | 3 ---
 2 files changed, 6 deletions(-)

Comments

Maxim Uvarov May 11, 2015, 10:25 a.m. UTC | #1
Tested this patch, looks good. But I think it's reasonable to add some 
description why
assert was removed.

I can add on merge something like:

"No need to check that  odp_packet_hdr_t is 64 bit aligned because it's 
part of
odp_packet_hdr_stride which is cache aligned. This assert fails in case 
of arm 64-32,
so just remove it from code."

Maxim.

On 05/08/2015 22:31, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   platform/linux-generic/include/odp_packet_internal.h | 3 ---
>   platform/linux-generic/odp_pool.c                    | 3 ---
>   2 files changed, 6 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
> index c3dcdd8..90dfe80 100644
> --- a/platform/linux-generic/include/odp_packet_internal.h
> +++ b/platform/linux-generic/include/odp_packet_internal.h
> @@ -139,9 +139,6 @@ typedef struct odp_packet_hdr_stride {
>   	uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_packet_hdr_t))];
>   } odp_packet_hdr_stride;
>   
> -_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/odp_pool.c b/platform/linux-generic/odp_pool.c
> index f887665..cd2c449 100644
> --- a/platform/linux-generic/odp_pool.c
> +++ b/platform/linux-generic/odp_pool.c
> @@ -35,9 +35,6 @@ typedef union buffer_type_any_u {
>   	odp_timeout_hdr_t tmo;
>   } odp_anybuf_t;
>   
> -_ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0,
> -		   "BUFFER_TYPE_ANY_U__SIZE_ERR");
> -
>   /* Any buffer type header */
>   typedef struct {
>   	union buffer_type_any_u any_hdr;    /* any buffer type */
Bill Fischofer May 11, 2015, 11:18 a.m. UTC | #2
That's fine with me.  Thanks.

On Mon, May 11, 2015 at 5:25 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Tested this patch, looks good. But I think it's reasonable to add some
> description why
> assert was removed.
>
> I can add on merge something like:
>
> "No need to check that  odp_packet_hdr_t is 64 bit aligned because it's
> part of
> odp_packet_hdr_stride which is cache aligned. This assert fails in case of
> arm 64-32,
> so just remove it from code."
>
> Maxim.
>
>
> On 05/08/2015 22:31, Bill Fischofer wrote:
>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   platform/linux-generic/include/odp_packet_internal.h | 3 ---
>>   platform/linux-generic/odp_pool.c                    | 3 ---
>>   2 files changed, 6 deletions(-)
>>
>> diff --git a/platform/linux-generic/include/odp_packet_internal.h
>> b/platform/linux-generic/include/odp_packet_internal.h
>> index c3dcdd8..90dfe80 100644
>> --- a/platform/linux-generic/include/odp_packet_internal.h
>> +++ b/platform/linux-generic/include/odp_packet_internal.h
>> @@ -139,9 +139,6 @@ typedef struct odp_packet_hdr_stride {
>>         uint8_t
>> pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_packet_hdr_t))];
>>   } odp_packet_hdr_stride;
>>   -_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/odp_pool.c
>> b/platform/linux-generic/odp_pool.c
>> index f887665..cd2c449 100644
>> --- a/platform/linux-generic/odp_pool.c
>> +++ b/platform/linux-generic/odp_pool.c
>> @@ -35,9 +35,6 @@ typedef union buffer_type_any_u {
>>         odp_timeout_hdr_t tmo;
>>   } odp_anybuf_t;
>>   -_ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0,
>> -                  "BUFFER_TYPE_ANY_U__SIZE_ERR");
>> -
>>   /* Any buffer type header */
>>   typedef struct {
>>         union buffer_type_any_u any_hdr;    /* any buffer type */
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov May 11, 2015, 4:43 p.m. UTC | #3
On 05/11/2015 14:18, Bill Fischofer wrote:
> That's fine with me.  Thanks.

Merged,
Maxim.

>
> On Mon, May 11, 2015 at 5:25 AM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Tested this patch, looks good. But I think it's reasonable to add
>     some description why
>     assert was removed.
>
>     I can add on merge something like:
>
>     "No need to check that  odp_packet_hdr_t is 64 bit aligned because
>     it's part of
>     odp_packet_hdr_stride which is cache aligned. This assert fails in
>     case of arm 64-32,
>     so just remove it from code."
>
>     Maxim.
>
>
>     On 05/08/2015 22:31, Bill Fischofer wrote:
>
>         Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>         <mailto:bill.fischofer@linaro.org>>
>         ---
>           platform/linux-generic/include/odp_packet_internal.h | 3 ---
>           platform/linux-generic/odp_pool.c | 3 ---
>           2 files changed, 6 deletions(-)
>
>         diff --git
>         a/platform/linux-generic/include/odp_packet_internal.h
>         b/platform/linux-generic/include/odp_packet_internal.h
>         index c3dcdd8..90dfe80 100644
>         --- a/platform/linux-generic/include/odp_packet_internal.h
>         +++ b/platform/linux-generic/include/odp_packet_internal.h
>         @@ -139,9 +139,6 @@ typedef struct odp_packet_hdr_stride {
>                 uint8_t
>         pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_packet_hdr_t))];
>           } odp_packet_hdr_stride;
>           -_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/odp_pool.c
>         b/platform/linux-generic/odp_pool.c
>         index f887665..cd2c449 100644
>         --- a/platform/linux-generic/odp_pool.c
>         +++ b/platform/linux-generic/odp_pool.c
>         @@ -35,9 +35,6 @@ typedef union buffer_type_any_u {
>                 odp_timeout_hdr_t tmo;
>           } odp_anybuf_t;
>           -_ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0,
>         -                  "BUFFER_TYPE_ANY_U__SIZE_ERR");
>         -
>           /* Any buffer type header */
>           typedef struct {
>                 union buffer_type_any_u any_hdr;    /* any buffer type */
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index c3dcdd8..90dfe80 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -139,9 +139,6 @@  typedef struct odp_packet_hdr_stride {
 	uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_packet_hdr_t))];
 } odp_packet_hdr_stride;
 
-_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/odp_pool.c b/platform/linux-generic/odp_pool.c
index f887665..cd2c449 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -35,9 +35,6 @@  typedef union buffer_type_any_u {
 	odp_timeout_hdr_t tmo;
 } odp_anybuf_t;
 
-_ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0,
-		   "BUFFER_TYPE_ANY_U__SIZE_ERR");
-
 /* Any buffer type header */
 typedef struct {
 	union buffer_type_any_u any_hdr;    /* any buffer type */