Re: [lng-odp] [PATCH] linux-generic: remove forward declarations of cos_t and pmr_t

2015-02-18 Thread Taras Kondratiuk

On 02/17/2015 11:35 PM, Maxim Uvarov wrote:

On 02/17/2015 11:28 PM, Bala wrote:

Reviewed-by: Bala Manoharan  bala.manoha...@linaro.org
mailto:bala.manoha...@linaro.org
P.S: A similar patch was proposed earlier by Taras also.


Yes, somehow everybody skipped review of Tarases patch set.


Yes, please review that series if we still need Clang support.


In current patch there is small difference, Taras left:

+union cos_u;
+union pmr_u;

And I don't. That is not needed.


I used to explicitly forward define structures or unions if they are 
used before definition, but in this case it seems to be redundant.


___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] linux-generic: remove forward declarations of cos_t and pmr_t

2015-02-17 Thread Maxim Uvarov
cos_t and pmr_t used only once, use union in that place
to make clang happy.
https://bugs.linaro.org/show_bug.cgi?id=1023

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 Note: did not test if clang error went away due to on my machine clang -k 
generates early warnings.

 platform/linux-generic/include/odp_classification_datamodel.h | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/platform/linux-generic/include/odp_classification_datamodel.h 
b/platform/linux-generic/include/odp_classification_datamodel.h
index 3b42e99..83500b0 100644
--- a/platform/linux-generic/include/odp_classification_datamodel.h
+++ b/platform/linux-generic/include/odp_classification_datamodel.h
@@ -47,9 +47,6 @@ extern C {
 /* Max PMR Term bits */
 #define ODP_PMR_TERM_BYTES_MAX 8
 
-/* forward declaration */
-typedef union pmr_u pmr_t;
-
 /**
 Packet Matching Rule Term Value
 
@@ -71,15 +68,14 @@ typedef struct pmr_term_value {
};
 } pmr_term_value_t;
 
-typedef union cos_u cos_t;
 /*
 Class Of Service
 */
 struct cos_s {
queue_entry_t *queue;   /* Associated Queue */
pool_entry_t *pool; /* Associated Buffer pool */
-   pmr_t *pmr; /* Chained PMR */
-   cos_t *linked_cos;  /* CoS linked with the PMR */
+   union pmr_u *pmr;   /* Chained PMR */
+   union cos_u *linked_cos;/* CoS linked with the PMR */
uint32_t valid; /* validity Flag */
odp_drop_e drop_policy; /* Associated Drop Policy */
odp_queue_group_t queue_group;  /* Associated Queue Group */
-- 
1.8.5.1.163.gd7aced9


___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: remove forward declarations of cos_t and pmr_t

2015-02-17 Thread Mike Holmes
On 17 February 2015 at 12:20, Maxim Uvarov maxim.uva...@linaro.org wrote:

 cos_t and pmr_t used only once, use union in that place
 to make clang happy.
 https://bugs.linaro.org/show_bug.cgi?id=1023

 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org


Tested-by: Mike Holmes mike.hol...@linaro.org


 ---
  Note: did not test if clang error went away due to on my machine clang -k
 generates early warnings.


I applied my Static_assert patch that is on the list to clean up the noise
first and then this patch and it fixed the bug 1023



  platform/linux-generic/include/odp_classification_datamodel.h | 8 ++--
  1 file changed, 2 insertions(+), 6 deletions(-)

 diff --git a/platform/linux-generic/include/odp_classification_datamodel.h
 b/platform/linux-generic/include/odp_classification_datamodel.h
 index 3b42e99..83500b0 100644
 --- a/platform/linux-generic/include/odp_classification_datamodel.h
 +++ b/platform/linux-generic/include/odp_classification_datamodel.h
 @@ -47,9 +47,6 @@ extern C {
  /* Max PMR Term bits */
  #define ODP_PMR_TERM_BYTES_MAX 8

 -/* forward declaration */
 -typedef union pmr_u pmr_t;
 -
  /**
  Packet Matching Rule Term Value

 @@ -71,15 +68,14 @@ typedef struct pmr_term_value {
 };
  } pmr_term_value_t;

 -typedef union cos_u cos_t;
  /*
  Class Of Service
  */
  struct cos_s {
 queue_entry_t *queue;   /* Associated Queue */
 pool_entry_t *pool; /* Associated Buffer pool */
 -   pmr_t *pmr; /* Chained PMR */
 -   cos_t *linked_cos;  /* CoS linked with the PMR */
 +   union pmr_u *pmr;   /* Chained PMR */
 +   union cos_u *linked_cos;/* CoS linked with the PMR */
 uint32_t valid; /* validity Flag */
 odp_drop_e drop_policy; /* Associated Drop Policy */
 odp_queue_group_t queue_group;  /* Associated Queue Group */
 --
 1.8.5.1.163.gd7aced9


 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/lng-odp




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: remove forward declarations of cos_t and pmr_t

2015-02-17 Thread Maxim Uvarov

On 02/17/2015 11:28 PM, Bala wrote:
Reviewed-by: Bala Manoharan  bala.manoha...@linaro.org 
mailto:bala.manoha...@linaro.org

P.S: A similar patch was proposed earlier by Taras also.


Yes, somehow everybody skipped review of Tarases patch set.
In current patch there is small difference, Taras left:

+union cos_u;
+union pmr_u;

And I don't. That is not needed.

Maxim.

On 17-Feb-2015, at 11:06 pm, Mike Holmes mike.hol...@linaro.org 
mailto:mike.hol...@linaro.org wrote:





On 17 February 2015 at 12:20, Maxim Uvarov maxim.uva...@linaro.org 
mailto:maxim.uva...@linaro.org wrote:


cos_t and pmr_t used only once, use union in that place
to make clang happy.
https://bugs.linaro.org/show_bug.cgi?id=1023

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
mailto:maxim.uva...@linaro.org

Tested-by: Mike Holmes mike.hol...@linaro.org 
mailto:mike.hol...@linaro.org


---
 Note: did not test if clang error went away due to on my machine
clang -k generates early warnings.


I applied my Static_assert patch that is on the list to clean up the 
noise first and then this patch and it fixed the bug 1023



 platform/linux-generic/include/odp_classification_datamodel.h |
8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git
a/platform/linux-generic/include/odp_classification_datamodel.h
b/platform/linux-generic/include/odp_classification_datamodel.h
index 3b42e99..83500b0 100644
--- a/platform/linux-generic/include/odp_classification_datamodel.h
+++ b/platform/linux-generic/include/odp_classification_datamodel.h
@@ -47,9 +47,6 @@ extern C {
 /* Max PMR Term bits */
 #define ODP_PMR_TERM_BYTES_MAX 8

-/* forward declaration */
-typedef union pmr_u pmr_t;
-
 /**
 Packet Matching Rule Term Value

@@ -71,15 +68,14 @@ typedef struct pmr_term_value {
};
 } pmr_term_value_t;

-typedef union cos_u cos_t;
 /*
 Class Of Service
 */
 struct cos_s {
queue_entry_t *queue;   /* Associated Queue */
pool_entry_t *pool; /* Associated Buffer pool */
-   pmr_t *pmr; /* Chained PMR */
-   cos_t *linked_cos;  /* CoS linked with the PMR */
+   union pmr_u *pmr;   /* Chained PMR */
+   union cos_u *linked_cos;/* CoS linked with the PMR */
uint32_t valid; /* validity Flag */
odp_drop_e drop_policy; /* Associated Drop Policy */
odp_queue_group_t queue_group;  /* Associated Queue Group */
--
1.8.5.1.163.gd7aced9


___
lng-odp mailing list
lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp




--
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp



___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp