[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <474E44C5.4020107@student.ltu.se>
Date: Thu, 29 Nov 2007 05:49:09 +0100
From: Richard Knutsson <ricknu-0@...dent.ltu.se>
To: Vegard Nossum <vegard.nossum@...il.com>
CC: linux-kernel@...r.kernel.org
Subject: Re: [RFC] kmemcheck: trap uses of uninitialized memory (v2)
Vegard Nossum wrote:
> Hi,
>
> On Nov 28, 2007 7:51 AM, Richard Knutsson <ricknu-0@...dent.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
-
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