From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755130AbcKJBcz (ORCPT ); Wed, 9 Nov 2016 20:32:55 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:46778 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754516AbcKJBcx (ORCPT ); Wed, 9 Nov 2016 20:32:53 -0500 Date: Wed, 09 Nov 2016 20:32:51 -0500 (EST) Message-Id: <20161109.203251.2242759501432326877.davem@davemloft.net> To: arnd@arndb.de Cc: thomas.lendacky@amd.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH] amd-xgbe: use __maybe_unused to hide pm functions From: David Miller In-Reply-To: <20161108133802.1716319-1-arnd@arndb.de> References: <20161108133802.1716319-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 09 Nov 2016 16:33:22 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Tue, 8 Nov 2016 14:37:32 +0100 > The amd-xgbe ethernet driver hides its suspend/resume functions > in #ifdef CONFIG_PM, but uses SIMPLE_DEV_PM_OPS() to make the > reference conditional on CONFIG_PM_SLEEP, which results in a > warning when PM_SLEEP is not set but PM is: > > drivers/net/ethernet/amd/xgbe/xgbe-platform.c:553:12: error: 'xgbe_platform_resume' defined but not used [-Werror=unused-function] > drivers/net/ethernet/amd/xgbe/xgbe-platform.c:533:12: error: 'xgbe_platform_suspend' defined but not used [-Werror=unused-function] > > This removes the incorrect #ifdef and instead uses a __maybe_unused > annotation to let the compiler know it can silently drop > the function definition. > > Fixes: bd8255d8ba35 ("amd-xgbe: Prepare for supporting PCI devices") > Signed-off-by: Arnd Bergmann > --- > I originally submitted this when in March 2016, but the patch has not > yet made it upstream, and the file contents have moved around so > the old patch no longer applied so I'm resending the rebased version > now. By and large, drivers handle this by using a CONFIG_PM_SLEEP ifdef. Unless you can make an extremely convincing argument why not to do so here, I'd like you to handle it that way instead. Thanks.