[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241023143204.GB9767@noisy.programming.kicks-ass.net>
Date: Wed, 23 Oct 2024 16:32:04 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
oe-kbuild-all@...ts.linux.dev, amadeuszx.slawinski@...ux.intel.com,
Tony Nguyen <anthony.l.nguyen@...el.com>,
nex.sw.ncis.osdt.itp.upstreaming@...el.com, netdev@...r.kernel.org,
Markus Elfring <Markus.Elfring@....de>,
Kees Cook <keescook@...omium.org>,
David Lechner <dlechner@...libre.com>,
Dan Carpenter <error27@...il.com>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v3] cleanup: adjust scoped_guard() macros to avoid
potential warning
On Wed, Oct 23, 2024 at 03:43:22PM +0200, Przemek Kitszel wrote:
> On 10/18/24 12:50, Peter Zijlstra wrote:
> > On Sun, Oct 13, 2024 at 12:01:24PM +0800, kernel test robot wrote:
> > --- a/include/linux/cleanup.h
> > +++ b/include/linux/cleanup.h
> > @@ -323,7 +323,7 @@ static __maybe_unused const bool class_#
> > */
> > #define __scoped_guard(_name, _fail, _label, args...) \
> > for (CLASS(_name, scope)(args); true; ({ goto _label; })) \
> > - if (!__guard_ptr(_name)(&scope) && __is_cond_ptr(_name)) { \
> > + if (__is_cond_ptr(_name) && !__guard_ptr(_name)(&scope)) { \
>
> but this will purge the attempt to call __guard_ptr(), and thus newer
> lock ;) good that there is at least some comment above
No, __guard_ptr() will only return a pointer, it has no action. The lock
callback is in CLASS(_name, scope)(args).
Powered by blists - more mailing lists