diff mbox

[API-NEXT,1/6] linux-generic: event: convert event types to typedef enum

Message ID 1435234172-2015-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer June 25, 2015, 12:09 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/include/odp/plat/event_types.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Bill Fischofer June 30, 2015, 11:52 a.m. UTC | #1
OK, thanks. I'll get a v2 out today.

On Tue, Jun 30, 2015 at 6:50 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>
>
> > -----Original Message-----
> > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of ext
> > Bill Fischofer
> > Sent: Thursday, June 25, 2015 3:09 PM
> > To: lng-odp@lists.linaro.org
> > Subject: [lng-odp] [API-NEXT PATCH 1/6] linux-generic: event: convert
> > event types to typedef enum
> >
> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> > ---
> >  platform/linux-generic/include/odp/plat/event_types.h | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/platform/linux-generic/include/odp/plat/event_types.h
> > b/platform/linux-generic/include/odp/plat/event_types.h
> > index d91937d..34b8ceb 100644
> > --- a/platform/linux-generic/include/odp/plat/event_types.h
> > +++ b/platform/linux-generic/include/odp/plat/event_types.h
> > @@ -30,10 +30,12 @@ typedef ODP_HANDLE_T(odp_event_t);
> >
> >  #define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
> >
> > -#define ODP_EVENT_BUFFER         1
> > -#define ODP_EVENT_PACKET         2
> > -#define ODP_EVENT_TIMEOUT        3
> > -#define ODP_EVENT_CRYPTO_COMPL   4
> > +typedef enum odp_event_type_e {
> > +     ODP_EVENT_BUFFER       = 1,
> > +     ODP_EVENT_PACKET       = 2,
> > +     ODP_EVENT_TIMEOUT      = 3,
> > +     ODP_EVENT_CRYPTO_COMPL = 4,
> > +} odp_event_type_e;
>
> 1)
> I think we agreed to standardize on typedef _t on all enums. So this
> should be named "odp_event_type_t"
>
> 2)
> This new type should be documented in api/event.h (not just implement it
> in plat).
>
> 3)
> These should be removed from api/event.h
>
> /**
>  * @def ODP_EVENT_BUFFER
>  * Buffer event
>  */
>
> /**
>  * @def ODP_EVENT_PACKET
>  * Packet event
>  */
>
> /**
>  * @def ODP_EVENT_TIMEOUT
>  * Timeout event
>  */
>
> /**
>  * @def ODP_EVENT_CRYPTO_COMPL
>  * Crypto completion event
>  */
>
> 4) This should be changed to use the new type
>
> int odp_event_type(odp_event_t event)
>
> 5) Update all test apps event type usage from "int" to odp_event_type_t
>
>
> So, this is a complete patch series of its own.
>
> -Petri
>
>
> >
> >  /** Get printable format of odp_event_t */
> >  static inline uint64_t odp_event_to_u64(odp_event_t hdl)
> > --
> > 2.1.0
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp/plat/event_types.h b/platform/linux-generic/include/odp/plat/event_types.h
index d91937d..34b8ceb 100644
--- a/platform/linux-generic/include/odp/plat/event_types.h
+++ b/platform/linux-generic/include/odp/plat/event_types.h
@@ -30,10 +30,12 @@  typedef ODP_HANDLE_T(odp_event_t);
 
 #define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
 
-#define ODP_EVENT_BUFFER         1
-#define ODP_EVENT_PACKET         2
-#define ODP_EVENT_TIMEOUT        3
-#define ODP_EVENT_CRYPTO_COMPL   4
+typedef enum odp_event_type_e {
+	ODP_EVENT_BUFFER       = 1,
+	ODP_EVENT_PACKET       = 2,
+	ODP_EVENT_TIMEOUT      = 3,
+	ODP_EVENT_CRYPTO_COMPL = 4,
+} odp_event_type_e;
 
 /** Get printable format of odp_event_t */
 static inline uint64_t odp_event_to_u64(odp_event_t hdl)