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
264 */264 */
265#define data_race(expr) \265#define data_race(expr) \
266({ \266({ \
267 __kcsan_disable_current(); \267 __unqual_scalar_typeof(({ expr; })) __v = ({ \
268 ({ \268 __kcsan_disable_current(); \
269 __unqual_scalar_typeof(({ expr; })) __v = ({ expr; }); \269 expr; \
270 __kcsan_enable_current(); \
271 __v; \
272 }); \270 }); \
271 __kcsan_enable_current(); \
272 __v; \
273})273})
274 274
275/*275/*