Hello, Aaron.

On Sun, Jan 06, 2013 at 10:48:25AM +0800, Aaron Lu wrote:
> +/* Check zero power ready status */
> +void zpodd_on_suspend(struct ata_device *dev)
> +{
> +     struct zpodd *zpodd = dev->zpodd;
> +     unsigned long expires;
> +
> +     if (!zpready(dev)) {
> +             zpodd->zp_ready = false;
> +             zpodd->last_ready = 0;
> +             return;
> +     }
> +
> +     if (!zpodd->last_ready) {
> +             zpodd->last_ready = jiffies;
> +             return;
> +     }
> +
> +     expires = zpodd->last_ready +
> +               msecs_to_jiffies(zpodd_poweroff_delay * 1000);
> +     if (time_before(jiffies, expires))
> +             return;
> +
> +     zpodd->zp_ready = true;
> +}

Using 0 jiffies as special value is generally considered a bad form.
It should be mostly ok here but it's not like avoiding that is
difficult, so let's please not use 0 jiffies as special value.  If you
have to, add another variable zp_sample_cnt or whatever.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to