]> git.neil.brown.name Git - history.git/commitdiff
Make constant types explicit, rather than depend on
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 25 May 2004 15:22:33 +0000 (08:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 25 May 2004 15:22:33 +0000 (08:22 -0700)
some rather subtle C type expansion rules.

This makes sparse happier.

include/asm-ppc64/mmu.h
include/asm-ppc64/mmu_context.h
include/asm-ppc64/page.h
include/linux/idr.h

index b42d9a4db08fb5962b62fdfac05ed66c3b5085e7..f9823b2ac584352e63a12d1e85cdd1e7e79d9cd7 100644 (file)
@@ -204,7 +204,7 @@ static inline unsigned long hpt_hash(unsigned long vpn, int large)
                page = vpn & 0xffff;
        }
 
-       return (vsid & 0x7fffffffff) ^ page;
+       return (vsid & 0x7fffffffffUL) ^ page;
 }
 
 static inline void __tlbie(unsigned long va, int large)
index 2682e04f91ab9e9cd4c3cc5c03b37be5c13bb6b4..ccdd9c21bcaa4860cd8a78aaa8c8ce62ec8dbb99 100644 (file)
@@ -175,8 +175,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 #define activate_mm(active_mm, mm) \
        switch_mm(active_mm, mm, current);
 
-#define VSID_RANDOMIZER 42470972311
-#define VSID_MASK      0xfffffffff
+#define VSID_RANDOMIZER 42470972311UL
+#define VSID_MASK      0xfffffffffUL
 
 
 /* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's
index 984602ae4fccf46fdc83014fe6163339c57f3de8..dbd626252c438f4246b5662105bf7bc1042ce72a 100644 (file)
 
 #include <linux/config.h>
 
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT     12
-#ifndef __ASSEMBLY__
-# define PAGE_SIZE     (1UL << PAGE_SHIFT)
+#ifdef __ASSEMBLY__
+  #define ASM_CONST(x) x
 #else
-# define PAGE_SIZE     (1 << PAGE_SHIFT)
+  #define ASM_CONST(x) x##UL
 #endif
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT     12
+#define PAGE_SIZE      (ASM_CONST(1) << PAGE_SHIFT)
 #define PAGE_MASK      (~(PAGE_SIZE-1))
 #define PAGE_OFFSET_MASK (PAGE_SIZE-1)
 
 #define SID_SHIFT       28
-#define SID_MASK        0xfffffffff
+#define SID_MASK        0xfffffffffUL
 #define GET_ESID(x)     (((x) >> SID_SHIFT) & SID_MASK)
 
 #ifdef CONFIG_HUGETLB_PAGE
@@ -196,11 +198,11 @@ extern int page_is_ram(unsigned long physaddr);
 /*       KERNELBASE is defined for performance reasons. */
 /*       When KERNELBASE moves, those macros may have   */
 /*             to change!                               */
-#define PAGE_OFFSET     0xC000000000000000
+#define PAGE_OFFSET     ASM_CONST(0xC000000000000000)
 #define KERNELBASE      PAGE_OFFSET
-#define VMALLOCBASE     0xD000000000000000
-#define IOREGIONBASE    0xE000000000000000
-#define EEHREGIONBASE   0xA000000000000000
+#define VMALLOCBASE     0xD000000000000000UL
+#define IOREGIONBASE    0xE000000000000000UL
+#define EEHREGIONBASE   0xA000000000000000UL
 
 #define IO_REGION_ID       (IOREGIONBASE>>REGION_SHIFT)
 #define EEH_REGION_ID      (EEHREGIONBASE>>REGION_SHIFT)
index 0aeae77806c719f7107d583e585c11f12b8ae4af..81439bfc0395994c5158cfe04f802cfafa5e3774 100644 (file)
 
 #if BITS_PER_LONG == 32
 # define IDR_BITS 5
-# define IDR_FULL 0xffffffff
+# define IDR_FULL 0xfffffffful
 #elif BITS_PER_LONG == 64
 # define IDR_BITS 6
-# define IDR_FULL 0xffffffffffffffff
+# define IDR_FULL 0xfffffffffffffffful
 #else
 # error "BITS_PER_LONG is not 32 or 64"
 #endif