From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D61522E83 for ; Mon, 8 Feb 2016 23:12:38 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 08 Feb 2016 14:12:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,418,1449561600"; d="scan'208";a="911138639" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 08 Feb 2016 14:12:10 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u18MC9Gk014131; Mon, 8 Feb 2016 22:12:09 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id u18MC9Dl019197; Mon, 8 Feb 2016 22:12:09 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id u18MC9jW019193; Mon, 8 Feb 2016 22:12:09 GMT From: Bruce Richardson To: dev@dpdk.org Date: Mon, 8 Feb 2016 22:11:49 +0000 Message-Id: <1454969509-19157-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] mlx4: fix unneeded function error with clang v3.6 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 22:12:39 -0000 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 --- 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