[dpdk-dev,5/7] mlx4: fix build with mempool debug enabled

Message ID 1425396230-13379-6-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Thomas Monjalon March 3, 2015, 3:23 p.m. UTC
  The mempool header forces error on -Wcast-qual and makes verbs.h failing.
Let's include verbs before as a system header.

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 lib/librte_pmd_mlx4/mlx4.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
  

Comments

Adrien Mazarguil March 3, 2015, 4:02 p.m. UTC | #1
On Tue, Mar 03, 2015 at 04:23:48PM +0100, Thomas Monjalon wrote:
> The mempool header forces error on -Wcast-qual and makes verbs.h failing.
> Let's include verbs before as a system header.
> 
> Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  lib/librte_pmd_mlx4/mlx4.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/lib/librte_pmd_mlx4/mlx4.c b/lib/librte_pmd_mlx4/mlx4.c
> index 492cbbf..b5774c4 100644
> --- a/lib/librte_pmd_mlx4/mlx4.c
> +++ b/lib/librte_pmd_mlx4/mlx4.c
> @@ -60,6 +60,16 @@
>  #include <linux/ethtool.h>
>  #include <linux/sockios.h>
>  
> +/* Verbs header. */
> +/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
> +#ifdef PEDANTIC
> +#pragma GCC diagnostic ignored "-pedantic"
> +#endif
> +#include <infiniband/verbs.h>
> +#ifdef PEDANTIC
> +#pragma GCC diagnostic error "-pedantic"
> +#endif
> +
>  /* DPDK headers don't like -pedantic. */
>  #ifdef PEDANTIC
>  #pragma GCC diagnostic ignored "-pedantic"
> @@ -81,18 +91,6 @@
>  #pragma GCC diagnostic error "-pedantic"
>  #endif
>  
> -/* Verbs header. */
> -/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
> -#ifdef PEDANTIC
> -#pragma GCC diagnostic ignored "-pedantic"
> -#endif
> -
> -#include <infiniband/verbs.h>
> -
> -#ifdef PEDANTIC
> -#pragma GCC diagnostic error "-pedantic"
> -#endif
> -
>  /* Generated configuration header. */
>  #include "mlx4_autoconf.h"
>  
> -- 
> 2.2.2

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
  

Patch

diff --git a/lib/librte_pmd_mlx4/mlx4.c b/lib/librte_pmd_mlx4/mlx4.c
index 492cbbf..b5774c4 100644
--- a/lib/librte_pmd_mlx4/mlx4.c
+++ b/lib/librte_pmd_mlx4/mlx4.c
@@ -60,6 +60,16 @@ 
 #include <linux/ethtool.h>
 #include <linux/sockios.h>
 
+/* Verbs header. */
+/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
+#ifdef PEDANTIC
+#pragma GCC diagnostic ignored "-pedantic"
+#endif
+#include <infiniband/verbs.h>
+#ifdef PEDANTIC
+#pragma GCC diagnostic error "-pedantic"
+#endif
+
 /* DPDK headers don't like -pedantic. */
 #ifdef PEDANTIC
 #pragma GCC diagnostic ignored "-pedantic"
@@ -81,18 +91,6 @@ 
 #pragma GCC diagnostic error "-pedantic"
 #endif
 
-/* Verbs header. */
-/* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-pedantic"
-#endif
-
-#include <infiniband/verbs.h>
-
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-pedantic"
-#endif
-
 /* Generated configuration header. */
 #include "mlx4_autoconf.h"