Re: [PATCH] function for checking if the dvb framework is idle

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

 



Hello Markus,

Markus Rechberger wrote:
> Could anyone comment or add this patch?
> 
> thanks,
> Markus
> 
>> +int dvb_frontend_eventstatus(struct dvb_frontend *fe)
>> +{
>> +      struct dvb_frontend_private *fepriv = fe->frontend_priv;
>> +      struct dvb_fe_events *events = &fepriv->events;
>> +      int ret;
>> +
>> +      if (mutex_lock_interruptible (&events->mtx))
>> +              return -EINTR;
>> +
>> +      ret = (fepriv->thread) ? true:false;
>> +      mutex_unlock (&events->mtx);
>> +
>> +      return ret;
>> +}

what does the mutex protect? Wouldn't the following code do the same?

int dvb_frontend_eventstatus(struct dvb_frontend *fe)
{
	struct dvb_frontend_private *fepriv = fe->frontend_priv;

	return (fepriv->thread != NULL);
}

I think the function name is misleading. At least it's not obvious for
me how the code relates to frontend events. A better name might be
dvb_frontend_active() or _running().

Best regards,
Andreas

_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux