Skip to content

Commit 7c81281

Browse files
Alexey Dobriyanakpm00
authored andcommitted
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 <adobriyan@gmail.com> Reviewed-by: Marco Elver <elver@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 961a285 commit 7c81281

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

include/linux/compiler.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
200200
*/
201201
#define data_race(expr) \
202202
({ \
203-
__unqual_scalar_typeof(({ expr; })) __v = ({ \
204-
__kcsan_disable_current(); \
205-
expr; \
206-
}); \
203+
__kcsan_disable_current(); \
204+
__auto_type __v = (expr); \
207205
__kcsan_enable_current(); \
208206
__v; \
209207
})

0 commit comments

Comments
 (0)