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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Aug 2009 18:23:06 +0800
From:	Amerigo Wang <amwang@...hat.com>
To:	Bernhard Walle <bernhard.walle@....de>
CC:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, tony.luck@...el.com,
	linux-ia64@...r.kernel.org, nhorman@...hat.com,
	ebiederm@...ssion.com, andi@...stfloor.org, fenghua.yu@...el.com,
	kamezawa.hiroyu@...fujitsu.com, avorontsov@...mvista.com
Subject: Re: [Patch 5/8] ia64: implement crashkernel=auto

Bernhard Walle wrote:
> * Ingo Molnar <mingo@...e.hu> [2009-08-24 09:43]:
>   
>> * Amerigo Wang <amwang@...hat.com> wrote:
>>     
>>> The reason that I kept 2ULL<<30 instead of 1ULL<<31 is that '1<<30' is  
>>> exactly 1G, so 2ULL<<30 can be easily read as 2G. ;)
>>>       
>> i have no trouble reading 1ULL<<31 as 2G ;-) OTOH, the logic and 
>> pattern of the comparisons (especially without the comment) looked 
>> odd at first sight, until i noticed this.
>>     
>
> Why not just something like
>
>     #define KBYTE(x)  ((x)*1024ULL)
>     #define MBYTE(x)  ((x)*1024ULL*1024)
>     #define GBYTE(x)  ((x)*1024ULL*1024*1024) 
>     #define TBYTE(x)  ((x)*1024ULL*1024*1024*1024)
>
> I find GBYTE(2) much easier to read than 1ULL<<31. Honestly, I would
> add a comment '/* 2G */' if I would write 1ULL<<31 in own code.
>
> But I'm of course not one of that super kernel hackers. ;-)
>
>   

Yeah, great. Here we only need MBYTES() and GBYTES(). ;)

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ