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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071031162755.981728B2D@place.org>
Date:	Wed, 31 Oct 2007 11:27:55 -0500
From:	Paul Jimenez <pj@...ce.org>
To:	Richard Knutsson <ricknu-0@...dent.ltu.se>
cc:	Paul Jimenez <pj@...ce.org>, rgooch@...f.csiro.au,
	linux-kernel@...r.kernel.org, pj@...ce.org
Subject: Re: [PATCH] mtrr use type bool 

On Wednesday, Oct 31, 2007, Richard Knutsson writes:
>>  		if (likely(replace < 0))
>>  			usage_table[i] = 1;
>>  		else {
>> -			usage_table[i] = usage_table[replace] + !!increment;
>> +			usage_table[i] = usage_table[replace] + increment;
>>   
>This seems a bit strange, using a boolean as an integer (yes I know, it 
>works but semantically...). What about:
>
>+			usage_table[i] = usage_table[replace];
>+			usage_table[i] += increment ? 1 : 0;
>? 

I've got no strong feelings either way.

  usage_table[i] = usage_table[replace];
  if (increment) usage_table[i]++; 

...would work just fine too.

>> index 289dfe6..54347e9 100644
>> --- a/arch/x86/kernel/cpu/mtrr/mtrr.h
>> +++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
>> @@ -2,10 +2,8 @@
>>   * local mtrr defines.
>>   */
>>  
>> -#ifndef TRUE
>> -#define TRUE  1
>> -#define FALSE 0
>> -#endif
>> +#include <linux/types.h>
>> +#include <linux/stddef.h>
>>   
>Isn't those included by default?

Are they?  I couldn't find the #includes so I put them in, figuring that at worst cpp will strip them.

>The rest looks good :)
>
>Richard Knutsson


Cool.  Any idea what maintainer I should send this to?  I'm not sure Mr. Gooch is still actively the mtrr maintainer.  Maybe the new x86 maintainers could apply it?

  --pj

-
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