From patchwork Tue Jun 6 08:58:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Kirsher X-Patchwork-Id: 103137 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1164592obh; Tue, 6 Jun 2017 01:58:24 -0700 (PDT) X-Received: by 10.84.210.33 with SMTP id z30mr20318380plh.235.1496739504636; Tue, 06 Jun 2017 01:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739504; cv=none; d=google.com; s=arc-20160816; b=IZnGRYSNug9obH9F/0/ww6eS4fSOq1OH+KlULnFRPwqau1YCQtGaX9xNu5bNDXyvuR eLTUI+vsiH/LTJRl5dOweOpW9o9U6PE69kdr/GnXYHfTaDqsTC+zmaH9COJAvKllUpjo aeFP9ekXhV9MOe4kHZOIzEgRCtyy991e97jvYpbrr/hrxNX2/T5pmoZnqnFCgfQMidfK AtZ5rvxggnSvE2ms3zZL9gyyTbS5RUXqpmuGcIP41cM0+Ew4w8E2n2WfHBy2pF84l+WG Qlzu7L0ljV9ZQUv7hbvnTXyDzuf57oq8vlOSCbUfj7E1zmUGb/e340vPMghlStB5NlXR VMAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ow1GGrceRaMdnYiKfsc8KyJwBX/endH2TfvmP9PxtoY=; b=FdpE67SufyUZMOGIHY7oJXV4rZwurCUbWAzioojNRlQGoPLnauxNqAfClrcRk8lA5W brb84IrRkcoqpbeamIEiRLAT+BfigziJSJMVxomjevC/6D9DpAzUk7OABbJPXEAF4ZXA ogwPetP21xOcXF20VI/LicAUGz1SisNzlLUt1bkDQ1ooonxI3NObOS+w1SWqbhmmRDNk WtmBvPP9kFPhLxEePn1SFp8R2WbLaUhcuq9Crfkf6YBGJ9W4LL3AqmTRYYljU56sTL+p j4fe/8bt1Jrj0lph+g1J7Z/iMY1XAgM/RGsqB5WB2Cas1OZCp8F631+pm2YefgDBqUp3 uVqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si20688701pgn.368.2017.06.06.01.58.24; Tue, 06 Jun 2017 01:58:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751448AbdFFI6S (ORCPT + 6 others); Tue, 6 Jun 2017 04:58:18 -0400 Received: from mga03.intel.com ([134.134.136.65]:30962 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbdFFI6P (ORCPT ); Tue, 6 Jun 2017 04:58:15 -0400 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2017 01:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,305,1493708400"; d="scan'208";a="111410839" Received: from vcesarx-mobl.amr.corp.intel.com (HELO jtkirshe-DESK.amr.corp.intel.com.com) ([10.255.85.150]) by fmsmga006.fm.intel.com with ESMTP; 06 Jun 2017 01:58:14 -0700 From: Jeff Kirsher To: davem@davemloft.net Cc: Arnd Bergmann , netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com, Jeff Kirsher Subject: [net-next 02/11] igb: mark PM functions as __maybe_unused Date: Tue, 6 Jun 2017 01:58:00 -0700 Message-Id: <20170606085809.78571-3-jeffrey.t.kirsher@intel.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170606085809.78571-1-jeffrey.t.kirsher@intel.com> References: <20170606085809.78571-1-jeffrey.t.kirsher@intel.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann The new wake function is only used by the suspend/resume handlers that are defined in inside of an #ifdef, which can cause this harmless warning: drivers/net/ethernet/intel/igb/igb_main.c:7988:13: warning: 'igb_deliver_wake_packet' defined but not used [-Wunused-function] Removing the #ifdef, instead using a __maybe_unused annotation simplifies the code and avoids the warning. Fixes: b90fa8763560 ("igb: Enable reading of wake up packet") Signed-off-by: Arnd Bergmann Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igb/igb_main.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) -- 2.12.2 diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 1cf74aa4ebd9..2d5bdb1fd37d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -191,10 +191,7 @@ static int igb_disable_sriov(struct pci_dev *dev); static int igb_pci_disable_sriov(struct pci_dev *dev); #endif -#ifdef CONFIG_PM -#ifdef CONFIG_PM_SLEEP static int igb_suspend(struct device *); -#endif static int igb_resume(struct device *); static int igb_runtime_suspend(struct device *dev); static int igb_runtime_resume(struct device *dev); @@ -204,7 +201,6 @@ static const struct dev_pm_ops igb_pm_ops = { SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume, igb_runtime_idle) }; -#endif static void igb_shutdown(struct pci_dev *); static int igb_pci_sriov_configure(struct pci_dev *dev, int num_vfs); #ifdef CONFIG_IGB_DCA @@ -8015,9 +8011,7 @@ static void igb_deliver_wake_packet(struct net_device *netdev) netif_rx(skb); } -#ifdef CONFIG_PM -#ifdef CONFIG_PM_SLEEP -static int igb_suspend(struct device *dev) +static int __maybe_unused igb_suspend(struct device *dev) { int retval; bool wake; @@ -8036,9 +8030,8 @@ static int igb_suspend(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static int igb_resume(struct device *dev) +static int __maybe_unused igb_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = pci_get_drvdata(pdev); @@ -8092,7 +8085,7 @@ static int igb_resume(struct device *dev) return err; } -static int igb_runtime_idle(struct device *dev) +static int __maybe_unused igb_runtime_idle(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = pci_get_drvdata(pdev); @@ -8104,7 +8097,7 @@ static int igb_runtime_idle(struct device *dev) return -EBUSY; } -static int igb_runtime_suspend(struct device *dev) +static int __maybe_unused igb_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); int retval; @@ -8124,11 +8117,10 @@ static int igb_runtime_suspend(struct device *dev) return 0; } -static int igb_runtime_resume(struct device *dev) +static int __maybe_unused igb_runtime_resume(struct device *dev) { return igb_resume(dev); } -#endif /* CONFIG_PM */ static void igb_shutdown(struct pci_dev *pdev) {