lkml.org 
[lkml]   [2008]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1 of 3] add phys_addr_t for holding physical addresses
Benjamin Herrenschmidt wrote:
> .../...
>
>
>> diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h
>> --- a/include/asm-x86/page_32.h
>> +++ b/include/asm-x86/page_32.h
>> @@ -33,7 +33,6 @@
>> typedef u64 pudval_t;
>> typedef u64 pgdval_t;
>> typedef u64 pgprotval_t;
>> -typedef u64 phys_addr_t;
>>
>
> .../...
>
> Might sound a stupid question, but why have a CONFIG_ option and
> a global definition based on it rather than each arch defining it
> as part of the base types ? I don't have a firm preference for one
> or the other at this point, I can see pro and cons to both approach,
> so I'm curious to see what others think about it.

My thinking is that:

There's only two possible types it can have: u32 and u64. If we leave
it to per-arch definitions, they'll come up with a variety of different
ways of spelling those types (like u64 itself, but I gather that's being
fixed).

Furthermore, with only a couple of exceptions, the size is the same as
the bitness of the architecture, so there's no need to set a config in
most cases.

So, avoiding lots of duplication, basically.

J


\
 
 \ /
  Last update: 2008-08-24 19:01    [W:0.054 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site