Skip to contentSkip to conversation

add new DMA_ADDR_T_SIZE define

PATCH Albert Cahalan 2 participants 3 messages Feb 23, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · David S. Miller
Quoted 2 lines · Ion Badulescu

then you're probably debugging, not performance-tuning, so the cast to u64 is acceptable.

Not true, you must cast to 'long long' as there is no appropriate printf format string for u64 that works warning-free on all systems.

Casts are ugly and they hide bugs. There is a fix for this problem: make u64 be "unsigned long long" for every arch. That works for both 32-bit and 64-bit systems. Likewise, choose "unsigned" for u32 even if an "unsigned long" would work for a given arch.

#1 lore raw

From: Albert Cahalan <[email protected]>
Date: 23 Feb 2003 02:02:01 -0500

Casts are ugly and they hide bugs. There is a fix for this problem: make u64 be "unsigned long long" for every arch. That works for both 32-bit and 64-bit systems. Likewise, choose "unsigned" for u32 even if an "unsigned long" would work for a given arch.

That merely hides the lack of user defined printf types in gcc, it doesn't make the real problem go away. What you suggest is merely a bandaid.

#2 lore raw
Quoted 9 lines · David S. Miller

From: Albert Cahalan <[email protected]>
Date: 23 Feb 2003 02:02:01 -0500

Casts are ugly and they hide bugs. There is a fix for this problem: make u64 be "unsigned long long" for every arch. That works for both 32-bit and 64-bit systems. Likewise, choose "unsigned" for u32 even if an "unsigned long" would work for a given arch.

Quoted 3 lines

That merely hides the lack of user defined printf types in gcc, it doesn't make the real problem go away. What you suggest is merely a bandaid.

Sure. It's an obviously useful bandaid that works with gcc 2.91, 2.92, 2.95, 2.96, 3.0, 3.2, 3.3, etc.