From patchwork Tue Jul 28 01:41:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1337443 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BFzgR3dFpz9sR4 for ; Tue, 28 Jul 2020 11:32:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgG1BcS (ORCPT ); Mon, 27 Jul 2020 21:32:18 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8832 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726196AbgG1BcR (ORCPT ); Mon, 27 Jul 2020 21:32:17 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id CA36E1FD25BA70411706; Tue, 28 Jul 2020 09:32:13 +0800 (CST) Received: from kernelci-master.huawei.com (10.175.101.6) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 28 Jul 2020 09:32:03 +0800 From: Wei Yongjun To: Hulk Robot , Jeff Kirsher , Jakub Kicinski , "Alexei Starovoitov" , Daniel Borkmann , "Jesper Dangaard Brouer" , John Fastabend , Akeem G Abodunrin CC: Wei Yongjun , , Subject: [PATCH net-next] ice: mark PM functions as __maybe_unused Date: Tue, 28 Jul 2020 09:41:53 +0800 Message-ID: <20200728014153.44834-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In certain configurations without power management support, the following warnings happen: drivers/net/ethernet/intel/ice/ice_main.c:4214:12: warning: 'ice_resume' defined but not used [-Wunused-function] 4214 | static int ice_resume(struct device *dev) | ^~~~~~~~~~ drivers/net/ethernet/intel/ice/ice_main.c:4150:12: warning: 'ice_suspend' defined but not used [-Wunused-function] 4150 | static int ice_suspend(struct device *dev) | ^~~~~~~~~~~ Mark these functions as __maybe_unused to make it clear to the compiler that this is going to happen based on the configuration, which is the standard for these types of functions. Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Tested-by: Andrew Bowers --- drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index d6981ba34b27..6edf018c4940 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4147,7 +4147,7 @@ static int ice_reinit_interrupt_scheme(struct ice_pf *pf) * Power Management callback to quiesce the device and prepare * for D3 transition. */ -static int ice_suspend(struct device *dev) +static int __maybe_unused ice_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct ice_pf *pf; @@ -4211,7 +4211,7 @@ static int ice_suspend(struct device *dev) * ice_resume - PM callback for waking up from D3 * @dev: generic device information structure */ -static int ice_resume(struct device *dev) +static int __maybe_unused ice_resume(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); enum ice_reset_req reset_type;