public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] kmemcheck: trap uses of uninitialized memory (v2)
Date: Thu, 29 Nov 2007 05:49:09 +0100	[thread overview]
Message-ID: <474E44C5.4020107@student.ltu.se> (raw)
In-Reply-To: <19f34abd0711281031r3d9ac97bw800aaeec87e86816@mail.gmail.com>

Vegard Nossum wrote:
> Hi,
>
> On Nov 28, 2007 7:51 AM, Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>   
>> Vegard Nossum wrote:
>>     
>>> +static int
>>>       
>> Not 'static bool'?
>>     
>>> +page_is_tracked(struct page *page)
>>>       
>> Why not returning 'false' and 'true'?
>>     
>
> Sorry, I am not used to using bool in C :-) I will change this if bool
> is preferred in kernel code.
>
>   
Well, why not use them since we have them (C99 standard and over a year 
in the kernel). ;)
What is "preferred" in a group of a few thousands, is hard to say, but I 
believe it is the way to go. The only "resistance" to it I know, is "it 
is not a C idiom". A quite illogical statement, at best. However, the 
0/1 vs false/true is just a preference. (I like false/true, since I also 
say "true AND false = false" for example... (NOT true = false, makes 
sense to me, NOT 1 = 0 seem strange, why can't it be 2, or -1 ;) ))
>>> +static unsigned int
>>> +opcode_get_size(const uint8_t *opcode)
>>>       
>> Are we not using 'u8' in the kernel?
>>     
>
> Actually, I don't see any reason to use u8 when uint8_t is already
> standard and used in other places in the kernel.
>   
I believe I have heard they can be a problem in some situations. It also 
have the benefit of uniforming the kernel-code.

cu
Richard Knutsson


  reply	other threads:[~2007-11-29  5:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 15:16 [RFC] kmemcheck: trap uses of uninitialized memory (v2) Vegard Nossum
2007-11-28  6:51 ` Richard Knutsson
2007-11-28 18:31   ` Vegard Nossum
2007-11-29  4:49     ` Richard Knutsson [this message]
2007-11-29  8:02 ` Pekka Enberg
2007-11-29  9:10   ` Vegard Nossum
2007-11-29  9:39     ` Pekka J Enberg
2007-11-29 10:04       ` Vegard Nossum
2007-11-29 12:05         ` Pekka J Enberg
2007-11-29 10:29 ` Andi Kleen
2007-11-29 13:24   ` Vegard Nossum
2007-11-29 13:45     ` Andi Kleen

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=474E44C5.4020107@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox