From: Alexey Dobriyan Date: Mon, 24 Jun 2024 15:39:49 +0000 (+0300) Subject: compiler.h: simplify data_race() macro X-Git-Tag: block-6.11-20240726~14^2~17 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7c812814e8c34a41bff6fe49987760ffaf8702af;p=linux-block.git compiler.h: simplify data_race() macro -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. Link: https://lkml.kernel.org/r/fb62163f-ba21-4661-be5b-bb5124abc87d@p183 Signed-off-by: Alexey Dobriyan Reviewed-by: Marco Elver Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 8c252e073bd8..2ea6120f3f7a 100644 --- 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; \ })