From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbcHZWsV (ORCPT ); Fri, 26 Aug 2016 18:48:21 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34459 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbcHZWsT (ORCPT ); Fri, 26 Aug 2016 18:48:19 -0400 Subject: Re: [PATCH] ravb: avoid unused function warnings To: Arnd Bergmann , "David S. Miller" References: <20160826153108.680850-1-arnd@arndb.de> Cc: Yoshihiro Kaneko , Kazuya Mizuguchi , Simon Horman , Masaru Nagai , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Sat, 27 Aug 2016 01:48:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160826153108.680850-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 08/26/2016 06:30 PM, Arnd Bergmann wrote: > When CONFIG_PM_SLEEP is disabled, we get a couple of harmless warnings: > > drivers/net/ethernet/renesas/ravb_main.c:2117:12: error: 'ravb_resume' defined but not used [-Werror=unused-function] > drivers/net/ethernet/renesas/ravb_main.c:2104:12: error: 'ravb_suspend' defined but not used [-Werror=unused-function] > > The simplest solution here is to replace the #ifdef with __maybe_unused > annotations, which lets the compiler do the right thing by itself. > > Signed-off-by: Arnd Bergmann > Fixes: 0184165b2f42 ("ravb: add sleep PM suspend/resume support") That was the patch I didn't review, sorry about that... > --- > drivers/net/ethernet/renesas/ravb_main.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index cad23ba06904..630536bc72f9 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c [...] > @@ -2166,17 +2165,12 @@ static const struct dev_pm_ops ravb_dev_pm_ops = { > SET_RUNTIME_PM_OPS(ravb_runtime_nop, ravb_runtime_nop, NULL) > }; > > -#define RAVB_PM_OPS (&ravb_dev_pm_ops) > -#else > -#define RAVB_PM_OPS NULL > -#endif > - > static struct platform_driver ravb_driver = { > .probe = ravb_probe, > .remove = ravb_remove, > .driver = { > .name = "ravb", > - .pm = RAVB_PM_OPS, > + .pm = &ravb_dev_pm_ops, I guess it's safe to have this pointing to the 'struct dev_pm_ops' filled with NULLs? Looking at the PM code left me somewhat unsure... [...] MBR, Sergei