Linux RTC
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: "linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"anson.huang@nxp.com" <anson.huang@nxp.com>,
	"a.zummo@towertech.it" <a.zummo@towertech.it>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>
Cc: "linux-imx@nxp.com" <linux-imx@nxp.com>
Subject: Re: [PATCH] rtc: snvs: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
Date: Mon, 29 Apr 2019 17:12:34 +0000	[thread overview]
Message-ID: <1556557953.31309.4.camel@impinj.com> (raw)
In-Reply-To: <1556521071-8981-1-git-send-email-Anson.Huang@nxp.com>

On Mon, 2019-04-29 at 07:02 +0000, Anson Huang wrote:
> Use __maybe_unused for power management related functions
> instead of #if CONFIG_PM_SLEEP to simply the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

This will result in the functions always being included, even if
PM_SLEEP is off...

>  
> @@ -387,14 +385,6 @@ static const struct dev_pm_ops snvs_rtc_pm_ops = {
>  	.resume_noirq = snvs_rtc_resume_noirq,
>  };

...because they will always be used by the definition of
snvs_rtc_pm_ops here.

In order for this to work, SIMPLE_DEV_PM_OPS() needs to be used,
so that the dev_pm_ops struct is empty when PM is off and the functions
don't get referenced. See: https://lkml.org/lkml/2019/1/17/376

  parent reply	other threads:[~2019-04-29 17:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  7:02 [PATCH] rtc: snvs: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Anson Huang
2019-04-29 10:37 ` Aisheng Dong
2019-04-29 17:12 ` Trent Piepho [this message]
2019-04-30  1:09   ` Anson Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1556557953.31309.4.camel@impinj.com \
    --to=tpiepho@impinj.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anson.huang@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox