lkml.org 
[lkml]   [2014]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] PM: define new ASSIGN_*_PM_OPS macros based on assign_if
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... and it
is useful tostart with simple (!PM) system when introducing new board.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-03-01 12:41    [W:0.118 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site