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]
Date:   Mon, 8 Jan 2018 13:44:24 -0800
From:   "H. Peter Anvin" <hpa@...or.com>
To:     Ingo Molnar <mingo@...nel.org>,
        Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Saidgani Musaev <cpu808694@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arch/x86/boot: sizeof macro

On 01/06/18 03:50, Ingo Molnar wrote:
> 
> We probably don't want to change then, and my point was that 99.8% of the current 
> usage is as a 'function':
> 
>   triton:~/tip> git grep 'sizeof(' | wc -l
>   116570
> 
>   triton:~/tip> git grep 'sizeof [:alnum:]' | wc -l
>   177
> 
> i.e. your patch moves it in the exact wrong direction.
> 

The bottom test is bogus as it is fairly common to do "sizeof *foo" in
addition to "sizeof foo":

: tazenda 139 ; git grep -P 'sizeof\s*[^\(\s]' | wc -l
2085

... but it certainly doesn't change the fact that the kernel coding
style is quite unambiguous.  However, I don't think it makes any sense
to patch just for the sake of patching.

I personally like the additional visual clarification (backed by
compiler assertion) that the argument is specifically an object, not a
type ("sizeof type" is invalid), but that's not the prevalent use in
kernel code.

	-hpa

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ