From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Josh Cartwright <joshc@codeaurora.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] PM: define new ASSIGN_*_PM_OPS macros based on assign_if
Date: Sat, 1 Mar 2014 08:02:31 -0800 [thread overview]
Message-ID: <20140301160231.GA9911@kroah.com> (raw)
In-Reply-To: <20140301110633.GA27749@amd.pavel.ucw.cz>
On Sat, Mar 01, 2014 at 12:06:33PM +0100, Pavel Machek wrote:
> Hi!
>
> > > +#define ASSIGN_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
> > > + .suspend = assign_if_pm_sleep(suspend_fn), \
> > > + .resume = assign_if_pm_sleep(resume_fn), \
> > > + .freeze = assign_if_pm_sleep(suspend_fn), \
> > > + .thaw = assign_if_pm_sleep(resume_fn), \
> > > + .poweroff = assign_if_pm_sleep(suspend_fn), \
> > > + .restore = assign_if_pm_sleep(resume_fn),
> >
> > Ugh, what a mess, really? Is it that hard to get the #ifdef right in
> > the code? Why not just always define the functions and then also always
> > have them in the structures, and if the feature isn't enabled, just
> > don't call/use them?
>
> The functions may not compile with CONFIG_PM disabled. (And #ifdefs in
> the code are considered ugly).
>
> > Yes, it would cause a _very_ tiny increase in code size if the option is
> > disabled, but really, does anyone ever disable those options becides on
> > the dreaded 'make randconfig' checkers?
>
> We don't want CONFIG_PM complexity on some embedded systems...
Really, what embedded systems do not want this?
> and it is useful tostart with simple (!PM) system when introducing new
> board.
I'm not saying to disable the option, I'm saying to stop worrying about
saving a few hundred bytes in individual drivers with this crazy #ifdef
and macro mess that no one understands and always gets wrong.
greg k-h
next prev parent reply other threads:[~2014-03-01 16:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 17:08 [PATCH 0/3] introduce assign_if() macros in attempt to reduce ifdeffery Josh Cartwright
2014-02-24 17:08 ` [PATCH 1/3] typecheck: introduce assign_if() and assign_if_enabled() Josh Cartwright
2014-02-27 19:00 ` Greg Kroah-Hartman
2014-02-27 23:48 ` Josh Cartwright
2014-02-24 17:08 ` [PATCH 2/3] PM: define new ASSIGN_*_PM_OPS macros based on assign_if Josh Cartwright
2014-02-27 19:02 ` Greg Kroah-Hartman
2014-03-01 11:06 ` Pavel Machek
2014-03-01 16:02 ` Greg Kroah-Hartman [this message]
2014-03-01 16:26 ` Pavel Machek
2014-02-24 17:08 ` [PATCH 3/3] usb: phy: msm: use ASSIGN_*_PM_OPS variants Josh Cartwright
2014-02-25 18:33 ` Felipe Balbi
2014-02-27 19:03 ` Greg Kroah-Hartman
2014-02-27 23:41 ` David Cohen
2014-02-27 23:44 ` Greg Kroah-Hartman
2014-02-27 23:52 ` David Cohen
2014-02-28 8:48 ` Ulf Hansson
2014-02-28 16:52 ` Greg Kroah-Hartman
2014-03-01 11:24 ` Ulf Hansson
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=20140301160231.GA9911@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=joshc@codeaurora.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/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