DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6
@ 2016-02-08 22:11 Bruce Richardson
  2016-02-09  8:39 ` Adrien Mazarguil
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2016-02-08 22:11 UTC (permalink / raw)
  To: dev

When compiling with clang 3.6, the mlx4 driver gives the following error
message about an unneeded function.

  CC mlx4.o
.../drivers/net/mlx4/mlx4.c:136:20: fatal error: function
      'wr_id_t_check' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static inline void wr_id_t_check(void)
                   ^
1 error generated.

The function is to compile-time check the size of wr_id_t, so use
the standard DPDK BUILD_BUG_ON macro to do so in the init function
instead.

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/mlx4/mlx4.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 207bfe2..ac162e9 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -132,15 +132,6 @@ typedef union {
 
 #define WR_ID(o) (((wr_id_t *)&(o))->data)
 
-/* Compile-time check. */
-static inline void wr_id_t_check(void)
-{
-	wr_id_t check[1 + (2 * -!(sizeof(wr_id_t) == sizeof(uint64_t)))];
-
-	(void)check;
-	(void)wr_id_t_check;
-}
-
 /* Transpose flags. Useful to convert IBV to DPDK flags. */
 #define TRANSPOSE(val, from, to) \
 	(((from) >= (to)) ? \
@@ -5685,6 +5676,8 @@ rte_mlx4_pmd_init(const char *name, const char *args)
 {
 	(void)name;
 	(void)args;
+
+	RTE_BUILD_BUG_ON(sizeof(wr_id_t) != sizeof(uint64_t));
 	/*
 	 * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use
 	 * huge pages. Calling ibv_fork_init() during init allows
-- 
2.5.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6
  2016-02-08 22:11 [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6 Bruce Richardson
@ 2016-02-09  8:39 ` Adrien Mazarguil
  2016-02-09 11:08   ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2016-02-09  8:39 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Mon, Feb 08, 2016 at 10:11:49PM +0000, Bruce Richardson wrote:
> When compiling with clang 3.6, the mlx4 driver gives the following error
> message about an unneeded function.
> 
>   CC mlx4.o
> .../drivers/net/mlx4/mlx4.c:136:20: fatal error: function
>       'wr_id_t_check' is not needed and will not be emitted
> [-Wunneeded-internal-declaration]
> static inline void wr_id_t_check(void)
>                    ^
> 1 error generated.
> 
> The function is to compile-time check the size of wr_id_t, so use
> the standard DPDK BUILD_BUG_ON macro to do so in the init function
> instead.
> 
> Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Thanks.

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

-- 
Adrien Mazarguil
6WIND

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6
  2016-02-09  8:39 ` Adrien Mazarguil
@ 2016-02-09 11:08   ` Bruce Richardson
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2016-02-09 11:08 UTC (permalink / raw)
  To: dev

On Tue, Feb 09, 2016 at 09:39:26AM +0100, Adrien Mazarguil wrote:
> On Mon, Feb 08, 2016 at 10:11:49PM +0000, Bruce Richardson wrote:
> > When compiling with clang 3.6, the mlx4 driver gives the following error
> > message about an unneeded function.
> > 
> >   CC mlx4.o
> > .../drivers/net/mlx4/mlx4.c:136:20: fatal error: function
> >       'wr_id_t_check' is not needed and will not be emitted
> > [-Wunneeded-internal-declaration]
> > static inline void wr_id_t_check(void)
> >                    ^
> > 1 error generated.
> > 
> > The function is to compile-time check the size of wr_id_t, so use
> > the standard DPDK BUILD_BUG_ON macro to do so in the init function
> > instead.
> > 
> > Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Thanks.
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> 
> -- 
Applied to dpdk-next-net/rel_16_04

/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-09 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 22:11 [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6 Bruce Richardson
2016-02-09  8:39 ` Adrien Mazarguil
2016-02-09 11:08   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).