[PATCH] compiler.h: simplify data_race() macro

From: Alexey Dobriyan
Date: Mon Jun 24 2024 - 07:49:39 EST


Use auto type deduction and comma expression to decrease macro expansion
size.

__unqual_scalar_typeof() is quite wordy macro by itself.

"expr" can be arbitrary complex so not expanding it twice is good.
Should be faster too because type is deduced only once
from the initializer.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

include/linux/compiler.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -200,10 +200,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
*/
#define data_race(expr) \
({ \
- __unqual_scalar_typeof(({ expr; })) __v = ({ \
- __kcsan_disable_current(); \
- expr; \
- }); \
+ __auto_type __v = (__kcsan_disable_current(), expr); \
__kcsan_enable_current(); \
__v; \
})