[dpdk-dev,v3,02/14] eventdev: fix errors with strict compilation flags

Message ID eb7fb2568f9ccc13bbd24eb0abe361590301c050.1493208189.git.adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Adrien Mazarguil April 26, 2017, 12:07 p.m. UTC
  Exported headers must allow compilation with the strictest flags. This
commit addresses the following errors:

 In file included from build/include/rte_eventdev_pmd.h:55:0,
                  from /tmp/check-includes.sh.25816.c:1:
 build/include/rte_eventdev.h:908:8: error: struct has no named members
    [-Werror=pedantic]
 [...]
 In file included from /tmp/check-includes.sh.25816.c:1:0:
 build/include/rte_eventdev_pmd.h:65:35: error: ISO C does not permit named
    variadic macros [-Werror=variadic-macros]
 [...]

Fixes: 71f238432865 ("eventdev: introduce event driven programming model")
Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs")

Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_eventdev/rte_eventdev.h     |  3 +--
 lib/librte_eventdev/rte_eventdev_pmd.h | 16 +++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)
  

Comments

Jerin Jacob April 26, 2017, 2:47 p.m. UTC | #1
-----Original Message-----
> Date: Wed, 26 Apr 2017 14:07:10 +0200
> From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> To: dev@dpdk.org
> Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "De Lara Guarch, Pablo"
>  <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH v3 02/14] eventdev: fix errors with strict compilation flags
> X-Mailer: git-send-email 2.1.4
> 
> Exported headers must allow compilation with the strictest flags. This
> commit addresses the following errors:
> 
>  In file included from build/include/rte_eventdev_pmd.h:55:0,
>                   from /tmp/check-includes.sh.25816.c:1:
>  build/include/rte_eventdev.h:908:8: error: struct has no named members
>     [-Werror=pedantic]
>  [...]
>  In file included from /tmp/check-includes.sh.25816.c:1:0:
>  build/include/rte_eventdev_pmd.h:65:35: error: ISO C does not permit named
>     variadic macros [-Werror=variadic-macros]
>  [...]
> 
> Fixes: 71f238432865 ("eventdev: introduce event driven programming model")
> Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs")
> 
> Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Cc: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
  

Patch

diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index b8ed6ef..20e7293 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -905,9 +905,9 @@  rte_event_dev_close(uint8_t dev_id);
  * The generic *rte_event* structure to hold the event attributes
  * for dequeue and enqueue operation
  */
+RTE_STD_C11
 struct rte_event {
 	/** WORD0 */
-	RTE_STD_C11
 	union {
 		uint64_t event;
 		/** Event attributes for dequeue or enqueue operation */
@@ -967,7 +967,6 @@  struct rte_event {
 		};
 	};
 	/** WORD1 */
-	RTE_STD_C11
 	union {
 		uint64_t u64;
 		/**< Opaque 64-bit value */
diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
index a73dc91..988018f 100644
--- a/lib/librte_eventdev/rte_eventdev_pmd.h
+++ b/lib/librte_eventdev/rte_eventdev_pmd.h
@@ -62,16 +62,18 @@  extern "C" {
 #endif
 
 /* Logging Macros */
-#define RTE_EDEV_LOG_ERR(fmt, args...) \
-	RTE_LOG(ERR, EVENTDEV, "%s() line %u: " fmt "\n",  \
-			__func__, __LINE__, ## args)
+#define RTE_EDEV_LOG_ERR(...) \
+	RTE_LOG(ERR, EVENTDEV, \
+		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
 
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
-#define RTE_EDEV_LOG_DEBUG(fmt, args...) \
-	RTE_LOG(DEBUG, EVENTDEV, "%s() line %u: " fmt "\n",  \
-			__func__, __LINE__, ## args)
+#define RTE_EDEV_LOG_DEBUG(...) \
+	RTE_LOG(DEBUG, EVENTDEV, \
+		RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
+			__func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__,)))
 #else
-#define RTE_EDEV_LOG_DEBUG(fmt, args...) (void)0
+#define RTE_EDEV_LOG_DEBUG(...) (void)0
 #endif
 
 /* Macros to check for valid device */