Re: [PATCH 2/2] gpio: sim: simplify code with cleanup helpers

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

 



On Tue, Aug 15, 2023 at 05:52:53PM +0200, Peter Zijlstra wrote:
> On Tue, Aug 15, 2023 at 10:04:32AM +0200, Linus Walleij wrote:
> > On Wed, Aug 9, 2023 at 3:14 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:


> > > -       mutex_lock(&chip->lock);
> > > +       guard(mutex)(&chip->lock);

> Looks about right.

Btw, why don't we have something like

	guard_mutex()

to be used as

	guard_mutex(&chip->lock);

Moreover, maybe some macro that can predict the API call from the type of
the parameter?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux