[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240222184505.7350df2e@bootlin.com>
Date: Thu, 22 Feb 2024 18:45:05 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Yury Norov
<yury.norov@...il.com>, Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, Andrew Lunn <andrew@...n.ch>, Mark Brown
<broonie@...nel.org>, Christophe Leroy <christophe.leroy@...roup.eu>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v4 1/5] net: wan: Add support for QMC HDLC
Andy, Jakub,
On Thu, 22 Feb 2024 18:56:26 +0200
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> 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@...ux.intel.com> 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.
Sure, thanks for the pointer.
Jakub,
nothing in drivers/net seems to use the guard() (from cleanup.h) family
macro.
Are you ok with having this HDLC driver that uses guard() macros ?
Best regards,
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists