Re: [PATCH 1/6] PM / sleep: Re-implement suspend-to-idle handling

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

 



On Wed, Feb 11, 2015 at 05:01:09AM +0100, Rafael J. Wysocki wrote:
> +/* Suspend-to-idle state machnine. */
> +enum freeze_state {
> +	FREEZE_STATE_NONE,      /* Not suspended/suspending. */
> +	FREEZE_STATE_ENTER,     /* Enter suspend-to-idle. */
> +	FREEZE_STATE_WAKE,      /* Wake up from suspend-to-idle. */
> +};
> +
> +static enum freeze_state __read_mostly suspend_freeze_state;
> +static DEFINE_SPINLOCK(suspend_freeze_lock);
> +
> +bool idle_should_freeze(void)
> +{
> +	return unlikely(suspend_freeze_state == FREEZE_STATE_ENTER);
> +}

I don't see how a compiler can propagate the unlikely through an actual
function call. AFAICT that needs to be an inline function for that to
work.

It would mean exposing suspend_freeze_state and the enum; is there a
reason not to want to do that?
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux