Re: [PATCH v3 2/4] iio: trigger: move to the cleanup.h magic

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

 



Thu, Feb 29, 2024 at 04:10:26PM +0100, Nuno Sa kirjoitti:
> Use the new cleanup magic for handling mutexes in IIO. This allows us to
> greatly simplify some code paths.

...

>  static void iio_trigger_put_irq(struct iio_trigger *trig, int irq)
>  {
> -	mutex_lock(&trig->pool_lock);
> +	guard(mutex)(&trig->pool_lock);
>  	clear_bit(irq - trig->subirq_base, trig->pool);

Another side note: Why do we need atomic bit operation(s)?

> -	mutex_unlock(&trig->pool_lock);
>  }

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux