From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexey Dobriyan' <adobriyan@gmail.com>, Marco Elver <elver@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: RE: [PATCH v2] compiler.h: simplify data_race() macro
Date: Fri, 28 Jun 2024 15:03:58 +0000 [thread overview]
Message-ID: <c452e41ed3d14c86aa0e05b4936c670b@AcuMS.aculab.com> (raw)
In-Reply-To: <fb62163f-ba21-4661-be5b-bb5124abc87d@p183>
From: Alexey Dobriyan
> Sent: 24 June 2024 16:40
>
> -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@gmail.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; \
> })
I think you can remove a lot of the tabs...
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2024-06-28 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 11:49 [PATCH] " Alexey Dobriyan
2024-06-24 12:27 ` Marco Elver
2024-06-24 14:37 ` Alexey Dobriyan
2024-06-24 14:41 ` Marco Elver
2024-06-24 14:42 ` Alexey Dobriyan
2024-06-24 15:09 ` Marco Elver
2024-06-24 15:39 ` [PATCH v2] " Alexey Dobriyan
2024-06-24 15:41 ` Marco Elver
2024-06-28 15:03 ` David Laight [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c452e41ed3d14c86aa0e05b4936c670b@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=elver@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®