All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Jimenez <pj@place.org>
To: Richard Knutsson <ricknu-0@student.ltu.se>
Cc: Paul Jimenez <pj@place.org>,
	rgooch@atnf.csiro.au, linux-kernel@vger.kernel.org, pj@place.org
Subject: Re: [PATCH] mtrr use type bool
Date: Wed, 31 Oct 2007 11:27:55 -0500	[thread overview]
Message-ID: <20071031162755.981728B2D@place.org> (raw)
In-Reply-To: <47289EE3.8080706@student.ltu.se>

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


  parent reply	other threads:[~2007-10-31 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  3:57 [PATCH] mtrr use type bool Paul Jimenez
2007-10-31 15:27 ` Richard Knutsson
2007-10-31 16:20   ` Lennart Sorensen
2007-10-31 20:25     ` Richard Knutsson
2007-10-31 16:27   ` Paul Jimenez [this message]
2007-10-31 20:49     ` Richard Knutsson
2007-11-02 20:14       ` [PATCH] mtrr use type bool [RESEND] Paul Jimenez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071031162755.981728B2D@place.org \
    --to=pj@place.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@atnf.csiro.au \
    --cc=ricknu-0@student.ltu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.