Skip to content

Commit 95c094f

Browse files
melverKAGA-KOKO
authored andcommitted
compiler.h: Avoid nested statement expression in data_race()
It appears that compilers have trouble with nested statement expressions. Therefore, remove one level of statement expression nesting from the data_race() macro. This will help avoiding potential problems in the future as its usage increases. Reported-by: Borislav Petkov <[email protected]> Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Marco Elver <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Will Deacon <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 44b97dc commit 95c094f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/compiler.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
264264
*/
265265
#define data_race(expr) \
266266
({ \
267-
__kcsan_disable_current(); \
268-
({ \
269-
__unqual_scalar_typeof(({ expr; })) __v = ({ expr; }); \
270-
__kcsan_enable_current(); \
271-
__v; \
267+
__unqual_scalar_typeof(({ expr; })) __v = ({ \
268+
__kcsan_disable_current(); \
269+
expr; \
272270
}); \
271+
__kcsan_enable_current(); \
272+
__v; \
273273
})
274274

275275
/*

0 commit comments

Comments
 (0)