Skip to contentSkip to conversation

x86_64: use UL on TASK_SIZE

PATCH In review Randy.Dunlap 2 participants 3 messages Jan 23, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86_64: use UL on TASK_SIZE

Use UL on large constant (kills 3214 sparse warnings :)

include/linux/sched.h:1150:18: warning: constant 0x800000000000 is so big it is long

diffstat:=

 include/asm-x86_64/processor.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
include/asm-x86_64/processor.h renamed from include/asm-x86_64/processor.h~proc_task_size +1 -1
diff -Naurp ./include/asm-x86_64/processor.h~proc_task_size ./include/asm-x86_64/processor.h
@@ -162,7 +162,7 @@ static inline void clear_in_cr4 (unsigne
 /*
  * User space process size. 47bits.
  */
-#define TASK_SIZE	(0x800000000000)
+#define TASK_SIZE	(0x800000000000UL)
 
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.

--

#1 lore raw
Quoted 4 lines · Randy.Dunlap

Use UL on large constant (kills 3214 sparse warnings :)

include/linux/sched.h:1150:18: warning: constant 0x800000000000 is so big it is long

Sounds more like a sparse bug to me. The C99 standard says the type of the constant is the first in which the constant can be represented. And that list includes unsigned long and even unsigned long long.

-Andi

#2 lore raw
Quoted 10 lines · Andi Kleen
Quoted 3 lines · Randy.Dunlap

Use UL on large constant (kills 3214 sparse warnings :)

include/linux/sched.h:1150:18: warning: constant 0x800000000000 is so big it is long

Sounds more like a sparse bug to me. The C99 standard says the type of the constant is the first in which the constant can be represented. And that list includes unsigned long and even unsigned long long.

Thanks, I'll take it up on the sparse m-l.

Signature · 1 line
~Randy