Re: [PATCH v2] PM / Runtime: Introduce pm_runtime_get_noidle

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

 



On Saturday, December 12, 2015 07:49:56 PM Chris Wilson wrote:
> On Sat, Dec 12, 2015 at 09:40:45PM +0200, Imre Deak wrote:
> > On Sat, 2015-12-12 at 02:51 +0100, Rafael J. Wysocki wrote:
> > > +bool pm_runtime_get_if_in_use(struct device *dev)
> > > +{
> > > +	unsigned long flags;
> > > +	bool retval;
> > > +
> > > +	spin_lock_irqsave(&dev->power.lock, flags);
> > > +	retval = dev->power.runtime_status == RPM_ACTIVE ?
> > > +		!!atomic_inc_not_zero(&dev->power.usage_count) :
> > > false;
> > > +	spin_unlock_irqrestore(&dev->power.lock, flags);
> > > +	return retval;
> > > +}
> > > +EXPORT_SYMBOL_GPL(pm_runtime_get_if_in_use);
> > > +
> > 
> > To me this looks ok:
> > Acked-by: Imre Deak <imre.deak@xxxxxxxxx>
> 
> Pendant says
> retval = (dev->power.runtime_status == RPM_ACTIVE &&
> 	  atomic_inc_not_zero(&dev->power.usage_count);

Well, this wouldn't build AFAICS.

retval = dev->power.runtime_status == RPM_ACTIVE &&
	atomic_inc_not_zero(&dev->power.usage_count);

Thanks,
Rafael

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux