Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754813AbbBFJHG (ORCPT ); Fri, 6 Feb 2015 04:07:06 -0500 Received: from mail-oi0-f46.google.com ([209.85.218.46]:55152 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751839AbbBFJG7 (ORCPT ); Fri, 6 Feb 2015 04:06:59 -0500 MIME-Version: 1.0 In-Reply-To: <20150206060953.GA34087@dtor-ws> References: <20150206060953.GA34087@dtor-ws> Date: Fri, 6 Feb 2015 17:06:58 +0800 Message-ID: Subject: Re: [PATCH] Input: bfin_rotary - mark suspend and resume code as __maybe_unused From: Sonic Zhang To: Dmitry Torokhov Cc: Sonic Zhang , linux-input@vger.kernel.org, Linux Kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2578 Lines: 78 Hi Dmitry, On Fri, Feb 6, 2015 at 2:09 PM, Dmitry Torokhov wrote: > Instead of using #ifdef to guard potentially unused suspend and resume code > let's mark them as __maybe_unused so they still get discarded if they are > not used but we do not get warning. This allows for better compile coverage. > > Signed-off-by: Dmitry Torokhov > --- > drivers/input/misc/bfin_rotary.c | 14 ++++---------- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c > index a39793c..09d7612 100644 > --- a/drivers/input/misc/bfin_rotary.c > +++ b/drivers/input/misc/bfin_rotary.c > @@ -232,8 +232,7 @@ static int bfin_rotary_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > -static int bfin_rotary_suspend(struct device *dev) > +static int __maybe_unused bfin_rotary_suspend(struct device *dev) > { > struct platform_device *pdev = to_platform_device(dev); > struct bfin_rot *rotary = platform_get_drvdata(pdev); > @@ -248,7 +247,7 @@ static int bfin_rotary_suspend(struct device *dev) > return 0; > } > > -static int bfin_rotary_resume(struct device *dev) > +static int __maybe_unused bfin_rotary_resume(struct device *dev) > { > struct platform_device *pdev = to_platform_device(dev); > struct bfin_rot *rotary = platform_get_drvdata(pdev); > @@ -266,20 +265,15 @@ static int bfin_rotary_resume(struct device *dev) > return 0; > } > > -static const struct dev_pm_ops bfin_rotary_pm_ops = { > - .suspend = bfin_rotary_suspend, > - .resume = bfin_rotary_resume, > -}; > -#endif > +static SIMPLE_DEV_PM_OPS(bfin_rotary_pm_ops, > + bfin_rotary_suspend, bfin_rotary_resume); > > static struct platform_driver bfin_rotary_device_driver = { > .probe = bfin_rotary_probe, > .remove = bfin_rotary_remove, > .driver = { > .name = "bfin-rotary", You missed .owner = THIS_MODULE, here. > -#ifdef CONFIG_PM > .pm = &bfin_rotary_pm_ops, > -#endif > }, > }; > module_platform_driver(bfin_rotary_device_driver); > -- > 2.2.0.rc0.207.ga3a616c > > Regards, Sonic -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/