Re: [PATCH RFC] introduce pm_call() macro to get rid of most #ifdef CONFIG_PM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 3 Mar 2008 02:43:08 +0300
Anton Vorontsov <cbouatmailru@xxxxxxxxx> wrote:

> Currently drivers handle CONFIG_PM this way:
> 
> #ifdef CONFIG_PM
> drv_suspend() {}
> drv_resume() {}
> #else
> #define drv_suspend NULL
> #define drv_resume NULL
> #endif
> 
> struct driver drv = {
> 	.suspend = drv_suspend,
> 	.resume = drv_resume,
> };
> 
> With this patch, the code above converts into:
> 
> drv_suspend() {}
> drv_resume() {}
> 
> struct driver drv = {
> 	.suspend = pm_call(drv_suspend),
> 	.resume = pm_call(drv_resume),
> };
> 
> GCC will optimize away suspend/resume calls if they're really
> not used.
> 


to be honest, at this point I would think it's time to remove CONFIG_PM, or rather,
just make it always be there and just get rid of the ifdefs. We're saving 2 words and a bit of code,
but only a case that not even the embedded guys use. 
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux