[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNMbLBLgy4-BGQYLkDcYO+vOzgq3ht41xzasEJ=x=o18Kw@mail.gmail.com>
Date: Mon, 24 Jun 2024 17:41:14 +0200
From: Marco Elver <elver@...gle.com>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH v2] compiler.h: simplify data_race() macro
On Mon, 24 Jun 2024 at 17:39, Alexey Dobriyan <adobriyan@...il.com> wrote:
>
> -Wdeclaration-after-statement used since forever required statement
> expressions to inject __kcsan_disable_current(), __kcsan_enable_current()
> to mark data race. Now that it is gone, make macro expansion simpler.
>
> __unqual_scalar_typeof() is wordy macro by itself.
> "expr" is expanded twice.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
Reviewed-by: Marco Elver <elver@...gle.com>
> ---
>
> include/linux/compiler.h | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -200,10 +200,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
> */
> #define data_race(expr) \
> ({ \
> - __unqual_scalar_typeof(({ expr; })) __v = ({ \
> - __kcsan_disable_current(); \
> - expr; \
> - }); \
> + __kcsan_disable_current(); \
> + __auto_type __v = (expr); \
> __kcsan_enable_current(); \
> __v; \
> })
Powered by blists - more mailing lists