lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 1 Mar 2014 17:26:03 +0100
From:	Pavel Machek <pavel@....cz>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Josh Cartwright <joshc@...eaurora.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <len.brown@...el.com>, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [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...
> 
> Really, what embedded systems do not want this?

Most of them? :-) In last four years, I cooperated on 4 of those, and
device power management was not requirement on any of those. Just one
was operated on battery that was "small".

> > 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.

I wrote: 

> > The functions may not compile with CONFIG_PM disabled. (And #ifdefs in
> > the code are considered ugly).

To reiterate: suspend_fn (etc) is likely to use stuff not avialable in
!PM case, so it will break your compilation if you don't add some
#ifdefs.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ