[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241023102620.GI16066@noisy.programming.kicks-ass.net>
Date: Wed, 23 Oct 2024 12:26:20 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@...el.com>,
linux-kernel@...r.kernel.org, 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 <dan.carpenter@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...el.com>
Subject: Re: [PATCH v4] cleanup: adjust scoped_guard() macros to avoid
potential warning
On Fri, Oct 18, 2024 at 12:15:50PM -0700, Dmitry Torokhov wrote:
> Hi Przemek,
>
> On Fri, Oct18, 2024 at 01:38:14PM +0200, Przemek Kitszel wrote:
> > Change scoped_guard() and scoped_cond_guard() macros to make reasoning
> > about them easier for static analysis tools (smatch, compiler
> > diagnostics), especially to enable them to tell if the given usage of
> > scoped_guard() is with a conditional lock class (interruptible-locks,
> > try-locks) or not (like simple mutex_lock()).
>
> Thank you for making all these improvements!
>
> >
> > +#define __DEFINE_CLASS_IS_CONDITIONAL(_name, _is_cond) \
> > +static __maybe_unused const bool class_##_name##_is_conditional = _is_cond
>
> Question - does this have to be a constant or can it be a macro?
One macro cannot define another.
Powered by blists - more mailing lists