lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <f214f15e-4a0a-4f24-9bd7-8f84cbc12e5a@p183>
Date: Mon, 24 Jun 2024 14:49:24 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>, Marco Elver <elver@...gle.com>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: [PATCH] compiler.h: simplify data_race() macro

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@...il.com>
---

 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;								\
 })

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ