net/i40e: fix clang warning on non-x86
authorRuifeng Wang <ruifeng.wang@arm.com>
Fri, 30 Jul 2021 09:32:58 +0000 (17:32 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 10 Aug 2021 07:48:33 +0000 (09:48 +0200)
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: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_rxtx.c

index 026cda9..8329cbd 100644 (file)
@@ -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