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-prev] [day] [month] [year] [list]
Message-ID: <c452e41ed3d14c86aa0e05b4936c670b@AcuMS.aculab.com>
Date: Fri, 28 Jun 2024 15:03:58 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Alexey Dobriyan' <adobriyan@...il.com>, Marco Elver <elver@...gle.com>
CC: Thomas Gleixner <tglx@...utronix.de>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "akpm@...ux-foundation.org"
	<akpm@...ux-foundation.org>
Subject: RE: [PATCH v2] compiler.h: simplify data_race() macro

From: Alexey Dobriyan
> Sent: 24 June 2024 16:40
> 
> -Wdeclaration-after-statement used since forever required statement
> expressions to inject __kcsan_disable_current(), __kcsan_enable_current()
> to mark data race. Now that it is gone, make macro expansion simpler.
> 
> __unqual_scalar_typeof() is wordy macro by itself.
> "expr" is expanded twice.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
> ---
> 
>  include/linux/compiler.h |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -200,10 +200,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
>   */
>  #define data_race(expr)							\
>  ({									\
> -	__unqual_scalar_typeof(({ expr; })) __v = ({			\
> -		__kcsan_disable_current();				\
> -		expr;							\
> -	});								\
> +	__kcsan_disable_current();					\
> +	__auto_type __v = (expr);					\
>  	__kcsan_enable_current();					\
>  	__v;								\
>  })

I think you can remove a lot of the tabs...

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ