Re: [PATCH v4 1/5] net: wan: Add support for QMC HDLC

From: Andy Shevchenko
Date: Thu Feb 22 2024 - 11:56:48 EST


On Thu, Feb 22, 2024 at 05:45:01PM +0100, Herve Codina wrote:
> On Thu, 22 Feb 2024 17:29:05 +0200
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, Feb 22, 2024 at 03:22:14PM +0100, Herve Codina wrote:

..

> > > + spin_lock_irqsave(&qmc_hdlc->tx_lock, flags);
> >
> > Why not using cleanup.h from day 1?
>
> I don't know about cleanup.h.
> Can you tell me more ?
> How should I use it ?
>
> > > +end:
> >
> > This label, in particular, will not be needed with above in place.
> >
> > > + spin_unlock_irqrestore(&qmc_hdlc->tx_lock, flags);
> > > + return ret;
> > > +}

Here are the examples:
6191e49de389 ("pinctrl: baytrail: Simplify code with cleanup helpers")
1d1b4770d4b6 ("platform/x86/intel/vsec: Use cleanup.h")
e2eeddefb046 ("pstore: inode: Convert mutex usage to guard(mutex)")

Some advanced stuff:
ced085ef369a ("PCI: Introduce cleanup helpers for device reference counts and locks")

Hope this helps.

--
With Best Regards,
Andy Shevchenko