From patchwork Wed Jan 20 10:42:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101147 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3094502lbb; Wed, 20 Jan 2016 02:43:15 -0800 (PST) X-Received: by 10.66.252.136 with SMTP id zs8mr51264582pac.110.1453286595334; Wed, 20 Jan 2016 02:43:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hh1si12400242pac.44.2016.01.20.02.43.15; Wed, 20 Jan 2016 02:43:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935031AbcATKnN (ORCPT + 29 others); Wed, 20 Jan 2016 05:43:13 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:63639 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933999AbcATKnK (ORCPT ); Wed, 20 Jan 2016 05:43:10 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0LvNfb-1aCFpV1p0V-010cob; Wed, 20 Jan 2016 11:42:30 +0100 From: Arnd Bergmann To: netdev@vger.kernel.org Cc: davem@davemloft.net, Jeff Kirsher , Jesse Brandeburg , Shannon Nelson , Carolyn Wyborny , Don Skidmore , Bruce Allan , John Ronciak , Mitch Williams , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] net: i40e: avoid unused function warnings Date: Wed, 20 Jan 2016 11:42:26 +0100 Message-ID: <2806620.EpZqDlZTO3@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:W8ZXETn45rKwRlLifZGBQiGkgNG1qqXlvrUzNlkWoTeIq2DQa/p jp9bygyXCYYlGOnzVoq+BkdSYSiFHo/TiRhLHf8Lf5lE2bLtvv/DDL85EB9SvnmZwyietZY abelHzFiGALnpl1eNyXggOeyFt3DYWHQ5w+USvGswxOpulYOGlklAejACx4p4gwHOD96LHR b0v1jFaPBW7azDImGnO4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:PZmf9a8PauA=:IQau89wnBPaojUhyw1+Wei iqPGx4TV2ezhA8NGJe9/y2qm5wOG5OukSkTbRQx7rZtogtQY5xGAUkH1/eQfb39qyizqo5Bvv rLdNb6vbDPnjaYC769Uh4YPmU+4GBuoDvHYDDjniT27dmhjoqAoMQqRtUffbcZQMDKDyvsIps Zu2aIX7OGyG3ff6//vwcnn+Xc/hKe9QqdXnSzmLo9CudZ6oE/MWvl1ADyObbDs6HZcveK45fJ p/HAEXZAK/S0rvSCi7hwDO39Bwlelw8mxLUU0It0nWC70VYKrIo5dkzu7cIv8vVPZuRRCKOao z8a8y8OIBhdjonmrOHosoftvAJWGo7ZpcYXnPHa1LC/kt+hszjGoz/7xj2wq8uqb2Dk1WQynF uV2qY57muAelcJYV+1ib+4UckOUqEPvBadAylqZgO1xAmhQSt5dAR/jzi9uQAirw2soXMbbiN z4xEmmz6pN+xCNfZp8b551vjOPROgylasfhWzLRUAXSDgtO9lmGseSgY2Y8sO00WwrEC/gqgW 7Cy0pXBPKP0fDqKe4W3OduZxzErRIQzBFkf6kf1sMiK/Rb9mKPNOC7xhah5dzR2ng44edSnIC UQWs6h2S/JO+YrqsI+cIj5B9l9BHjsRE7cyBSjUWq1cOgoyPJ5LF/4v3oYF07u4L0UVzw883V YQqEZ8WyN2LGFqJaT8/0yLSkRw7BdEBUvkLSP6sGvmmTbvmYQOHihnWRABMBrLdblu0OaQlTf 5G5tx0t+C/4qRN2a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The addition of the geneve tunnel offload code left a couple of functions unconditionally defined but empty whenever CONFIG_VXLAN and CONFIG_GENEVE are disabled. gcc warns about this: i40e_main.c:7049:13: warning: 'i40e_sync_udp_filters_subtask' defined but not used [-Wunused-function] i40e_main.c:8516:13: warning: 'i40e_add_vxlan_port' defined but not used [-Wunused-function] i40e_main.c:8561:13: warning: 'i40e_del_vxlan_port' defined but not used [-Wunused-function] i40e_main.c:8596:13: warning: 'i40e_add_geneve_port' defined but not used [-Wunused-function] i40e_main.c:8643:13: warning: 'i40e_del_geneve_port' defined but not used [-Wunused-function] This moves the #ifdef statements to the outside of the affected functions, which avoids the warnings. Signed-off-by: Arnd Bergmann Fixes: 6a899024058d ("i40e: geneve tunnel offload support") --- This is a harmless regression against v4.4, found on ARM randconfig builds Signed-off-by: Arnd Bergmann diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index bb4612c159fd..49ab0426b773 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -7056,7 +7056,6 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf) **/ static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf) { -#if IS_ENABLED(CONFIG_VXLAN) || IS_ENABLED(CONFIG_GENEVE) struct i40e_hw *hw = &pf->hw; i40e_status ret; __be16 port; @@ -7090,7 +7089,6 @@ static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf) } } } -#endif } /** @@ -7117,9 +7115,8 @@ static void i40e_service_task(struct work_struct *work) i40e_watchdog_subtask(pf); i40e_fdir_reinit_subtask(pf); i40e_sync_filters_subtask(pf); -#if IS_ENABLED(CONFIG_VXLAN) || IS_ENABLED(CONFIG_GENEVE) - i40e_sync_udp_filters_subtask(pf); -#endif + if (IS_ENABLED(CONFIG_VXLAN) || IS_ENABLED(CONFIG_GENEVE)) + i40e_sync_udp_filters_subtask(pf); i40e_clean_adminq_subtask(pf); i40e_service_event_complete(pf); @@ -8515,6 +8512,7 @@ static u8 i40e_get_udp_port_idx(struct i40e_pf *pf, __be16 port) } #endif +#if IS_ENABLED(CONFIG_VXLAN) /** * i40e_add_vxlan_port - Get notifications about VXLAN ports that come up * @netdev: This physical port's netdev @@ -8524,7 +8522,6 @@ static u8 i40e_get_udp_port_idx(struct i40e_pf *pf, __be16 port) static void i40e_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, __be16 port) { -#if IS_ENABLED(CONFIG_VXLAN) struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_vsi *vsi = np->vsi; struct i40e_pf *pf = vsi->back; @@ -8557,7 +8554,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev, pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN; pf->pending_udp_bitmap |= BIT_ULL(next_idx); pf->flags |= I40E_FLAG_UDP_FILTER_SYNC; -#endif } /** @@ -8569,7 +8565,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev, static void i40e_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family, __be16 port) { -#if IS_ENABLED(CONFIG_VXLAN) struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_vsi *vsi = np->vsi; struct i40e_pf *pf = vsi->back; @@ -8592,9 +8587,10 @@ static void i40e_del_vxlan_port(struct net_device *netdev, netdev_warn(netdev, "vxlan port %d was not found, not deleting\n", ntohs(port)); } -#endif } +#endif +#if IS_ENABLED(CONFIG_GENEVE) /** * i40e_add_geneve_port - Get notifications about GENEVE ports that come up * @netdev: This physical port's netdev @@ -8604,7 +8600,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev, static void i40e_add_geneve_port(struct net_device *netdev, sa_family_t sa_family, __be16 port) { -#if IS_ENABLED(CONFIG_GENEVE) struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_vsi *vsi = np->vsi; struct i40e_pf *pf = vsi->back; @@ -8639,7 +8634,6 @@ static void i40e_add_geneve_port(struct net_device *netdev, pf->flags |= I40E_FLAG_UDP_FILTER_SYNC; dev_info(&pf->pdev->dev, "adding geneve port %d\n", ntohs(port)); -#endif } /** @@ -8651,7 +8645,6 @@ static void i40e_add_geneve_port(struct net_device *netdev, static void i40e_del_geneve_port(struct net_device *netdev, sa_family_t sa_family, __be16 port) { -#if IS_ENABLED(CONFIG_GENEVE) struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_vsi *vsi = np->vsi; struct i40e_pf *pf = vsi->back; @@ -8677,8 +8670,8 @@ static void i40e_del_geneve_port(struct net_device *netdev, netdev_warn(netdev, "geneve port %d was not found, not deleting\n", ntohs(port)); } -#endif } +#endif static int i40e_get_phys_port_id(struct net_device *netdev, struct netdev_phys_item_id *ppid)