Thread (2 messages) flat view 2 messages, 2 authors, 2008-07-12

Re: linux-next: kbuild tree build failure

From: Roman Zippel <hidden>
Date: 2008-07-12 23:21:38
Also in: lkml

Hi,

On Sat, 12 Jul 2008, Milton Miller wrote:
(1) #define PAGE_OFFSET    (ASM_CONST(CONFIG_PAGE_OFFSET) << 32)

It creates unreadable code, where two defines with almost the same name (the
only difference being
the CONFIG_ prefix, which is often ignored when scanning) contains radically
different values.

(2)  #define PAGE_OFFSET    ASM_CONST(CONFIG_PAGE_OFFSET)
Giving it different names is not really difficult. Any objections to 
CONFIG_PAGE_HIGH_OFFSET?
On a seperate note,
quoted
quoted
quoted
quoted
 config PINT3_ASSIGN
        hex "PINT3_ASSIGN"
        depends on PINTx_REASSIGN
-       default 0x02020303
+       default 0x2020303
is harder to read.   The value is a list of 4 1 byte values, but you have
hidden the first nibble making parsing the rest of the value hard.
Sam mentioned that already, but that's a situation where the warning can 
be relaxed.
If you are worried about users tring to set values that are too high,
then make the types be hex8, hex16, hex32, and hex64.
It's not this, I value consistency as much as you and the values are 
sometimes used as integers, so a working range is needed. Using simple 
integers keeps things much simpler and as the ASM_CONST example shows any 
bigger values are not necessarily directly usable anyway.

bye, Roman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help