History

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.

Marco Elver committed 6 years ago

Commit 95c094f1 parent 44b97dc1 file · +5 −5Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/compiler.h+5−5
@@ -264,12 +264,12 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 263 unmodified lines
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 /*