Re: [PATCH v12 4/9] libata: check zero power ready status for ZPODD

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

 



Hello, Aaron.

On Thu, Jan 10, 2013 at 05:24:25PM +0800, Aaron Lu wrote:
> +/*
> + * Update the zpodd->zp_ready field. This field will only be set
> + * if the ODD has stayed in ZP ready state for zpodd_poweroff_delay
> + * time, and will be used to decide if power off is allowed. If it
> + * is set, it will be cleared during resume from powered off state.
> + */
> +void zpodd_on_suspend(struct ata_device *dev)
> +{
> +	struct zpodd *zpodd = dev->zpodd;
> +	unsigned long expires;
> +
> +	if (!zpready(dev)) {
> +		zpodd->zp_sampled = false;
> +		return;
> +	}
> +
> +	if (!zpodd->zp_sampled) {
> +		zpodd->zp_sampled = true;
> +		zpodd->last_ready = jiffies;
> +		return;

Is the above return necessary?  Can't we just fall through and always
check the actual condition?

> +	}
> +
> +	expires = zpodd->last_ready +
> +		  msecs_to_jiffies(zpodd_poweroff_delay * 1000);
> +	if (time_before(jiffies, expires))
> +		return;
> +
> +	zpodd->zp_ready = true;
> +}

Thanks.

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