From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D842A0547; Mon, 21 Jun 2021 01:31:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D58AB41141; Mon, 21 Jun 2021 01:30:57 +0200 (CEST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mails.dpdk.org (Postfix) with ESMTP id 9C0724111D; Mon, 21 Jun 2021 01:30:56 +0200 (CEST) Received: by mail-lf1-f43.google.com with SMTP id j2so27044524lfg.9; Sun, 20 Jun 2021 16:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T6VR+Z9BIQbK5k5XVCdLcOpp6leanuZ6l+VRLqzIw/g=; b=c1FNQ4E5l+3sQOKD7bQZlpS1DKVpQb8hY3EAuG3DugMYYXUfncfNezdGAJ2KmLxTi1 Xdb8METZE1eBr4v0TMOiDyXsNimulKthAQOoOBQXKAmvlC8ZqWVmr0eABnB3JwKCs5K4 6GGgzqS03zpC3f4YlQm2/x7otBeImVkNW/TH5pmyO5qoXHEsgK3aUuhbjDMyQpHuFwRP cVfWVsoLnHrd6shlu54jSvR5aJxgkEg5KIQZvQoDtpio8DGmwF6/f4tge2BAbsD+azek gcl6cHDyInVFguLXvnZDFW1Km2v0CYmjAfE8t42O66IaAfw8SvA0CJaFQWdJb2a8fGw6 fyNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T6VR+Z9BIQbK5k5XVCdLcOpp6leanuZ6l+VRLqzIw/g=; b=Dk/yz5UJxFM+bLfixD868XNATzIBetnaFVvnlsGYriTRpBE2W6a31bJ5N/2hMrj+XT h4ydqqEG7bgxMRmwmkLazxJ5LQo+k5D9XQzHUi/KGAzRfIsvJzTB67AdlXgmeahfe2nC xv6SuJxcsH5k70cVyvtqudrDXeVN2SYCXfiXyakqAa7bK9FxkImT5oRbln4zyFM8QseA 9IFUxSVL22aJaPm60bzqRjR9e4TCDC674CMKwc+ALJrHxS7tEHQcWEn1DG/GtSkSLvpB DpLxhdDLMYBuuUDZGKHe3ZvIcia+0L63UYHySUGg+FKWmzim+aZGffN//4NNxYOnALng omfw== X-Gm-Message-State: AOAM531rWSjRDUs+fr+YVty8oixrhSZGXhrS6lyNj3FoBfcunoTsN9Sf Lmmug3m8qQ3VtgOY50vTAmg= X-Google-Smtp-Source: ABdhPJwHTNr9SSGxiW4Lp/oQme12vgTzcoapCPMwRtNR5I9/kA+86cohd07qv/VH0erqRlFxrEKBcQ== X-Received: by 2002:a05:6512:c10:: with SMTP id z16mr2970094lfu.249.1624231856300; Sun, 20 Jun 2021 16:30:56 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id q21sm1677882lfp.233.2021.06.20.16.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 16:30:55 -0700 (PDT) Date: Mon, 21 Jun 2021 02:30:53 +0300 From: Dmitry Kozlyuk To: Jie Zhou Cc: dev@dpdk.org, xiaoyun.li@intel.com, roretzla@microsoft.com, talshn@nvidia.com, pallavi.kadam@intel.com, thomas@monjalon.net, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, stable@dpdk.org Message-ID: <20210621023053.07b8a425@sovereign> In-Reply-To: <1620241931-28435-10-git-send-email-jizh@linux.microsoft.com> References: <1620236174-10676-1-git-send-email-jizh@linux.microsoft.com> <1620241931-28435-1-git-send-email-jizh@linux.microsoft.com> <1620241931-28435-10-git-send-email-jizh@linux.microsoft.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v13 09/10] app/testpmd: fix unused function warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2021-05-05 12:12 (UTC-0700), Jie Zhou: > Function print_fdir_mask and print_fdir_flex_payload is only called > when either i40e or ixgbe presents. Add #if defined to remove > "unused function" compilation warning. > > Signed-off-by: Jie Zhou > Signed-off-by: Jie Zhou > Acked-by: Tal Shnaiderman > --- > app/test-pmd/config.c | 82 +++++++++++++++++++++---------------------- > 1 file changed, 41 insertions(+), 41 deletions(-) Code inside #ifdef isn't compile-checked, it's better to avoid. The only case we can't is when i40e or ixgbe API is called directly. I'd rather remove #ifdef whenever possible and mark maybe-unused entities, like this: diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3723317ab4..97a577fec0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4488,8 +4488,6 @@ flowtype_to_str(uint16_t flow_type) return NULL; } -#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) - static inline void print_fdir_mask(struct rte_eth_fdir_masks *mask) { @@ -4590,6 +4588,9 @@ get_fdir_info(portid_t port_id, struct rte_eth_fdir_info *fdir_info, { int ret = -ENOTSUP; + RTE_SET_USED(fdir_info); + RTE_SET_USED(fdir_stat); + #ifdef RTE_NET_I40E if (ret == -ENOTSUP) { ret = rte_pmd_i40e_get_fdir_info(port_id, fdir_info); @@ -4686,8 +4687,6 @@ fdir_get_infos(portid_t port_id) fdir_stats_border, fdir_stats_border); } -#endif /* RTE_NET_I40E || RTE_NET_IXGBE */ - void fdir_set_flex_mask(portid_t port_id, struct rte_eth_fdir_flex_mask *cfg) { diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index d61a055bdd..a40ee902e8 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -917,9 +917,7 @@ int all_ports_stopped(void); int port_is_stopped(portid_t port_id); int port_is_started(portid_t port_id); void pmd_test_exit(void); -#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) void fdir_get_infos(portid_t port_id); -#endif void fdir_set_flex_mask(portid_t port_id, struct rte_eth_fdir_flex_mask *cfg); void fdir_set_flex_payload(portid_t port_id,