diff mbox series

net/i40e: fix clang warning on non-x86

Message ID 20210730093258.46064-1-ruifeng.wang@arm.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series net/i40e: fix clang warning on non-x86 | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot success github build: passed
ci/checkpatch warning coding style issues

Commit Message

Ruifeng Wang July 30, 2021, 9:32 a.m. UTC
Build on aarch64 with clang-10 has warning:
i40e_rxtx.c:3228:1: warning: unused function 'get_avx_supported' [-Wunused-function]

The function is used in x86 specific path. Moved it into ifdef
to fix build on non-x86.

Fixes: c30751afc360 ("net/i40e: fix data path selection in secondary process")
Cc: dapengx.yu@intel.com

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/i40e/i40e_rxtx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Zhang, Qi Z Aug. 10, 2021, 7:51 a.m. UTC | #1
> -----Original Message-----
> From: Ruifeng Wang <ruifeng.wang@arm.com>
> Sent: Friday, July 30, 2021 5:33 PM
> To: Xing, Beilei <beilei.xing@intel.com>; Yu, DapengX
> <dapengx.yu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com;
> nd@arm.com; Ruifeng Wang <ruifeng.wang@arm.com>
> Subject: [PATCH] net/i40e: fix clang warning on non-x86
> 
> Build on aarch64 with clang-10 has warning:
> i40e_rxtx.c:3228:1: warning: unused function 'get_avx_supported'
> [-Wunused-function]
> 
> The function is used in x86 specific path. Moved it into ifdef to fix build on
> non-x86.
> 
> Fixes: c30751afc360 ("net/i40e: fix data path selection in secondary process")
> Cc: dapengx.yu@intel.com
> 
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 026cda948c..8329cbdd4e 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3224,10 +3224,10 @@  i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.offloads = txq->offloads;
 }
 
+#ifdef RTE_ARCH_X86
 static inline bool
 get_avx_supported(bool request_avx512)
 {
-#ifdef RTE_ARCH_X86
 	if (request_avx512) {
 		if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
 		rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
@@ -3251,12 +3251,10 @@  get_avx_supported(bool request_avx512)
 		return false;
 #endif
 	}
-#else
-	RTE_SET_USED(request_avx512);
-#endif /* RTE_ARCH_X86 */
 
 	return false;
 }
+#endif /* RTE_ARCH_X86 */
 
 
 void __rte_cold