Commit cb0c8b62 authored by Linus Torvalds's avatar Linus Torvalds

Make constant types explicit, rather than depend on

some rather subtle C type expansion rules.

This makes sparse happier.
parent d824e08a
...@@ -204,7 +204,7 @@ static inline unsigned long hpt_hash(unsigned long vpn, int large) ...@@ -204,7 +204,7 @@ static inline unsigned long hpt_hash(unsigned long vpn, int large)
page = vpn & 0xffff; page = vpn & 0xffff;
} }
return (vsid & 0x7fffffffff) ^ page; return (vsid & 0x7fffffffffUL) ^ page;
} }
static inline void __tlbie(unsigned long va, int large) static inline void __tlbie(unsigned long va, int large)
......
...@@ -175,8 +175,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, ...@@ -175,8 +175,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
#define activate_mm(active_mm, mm) \ #define activate_mm(active_mm, mm) \
switch_mm(active_mm, mm, current); switch_mm(active_mm, mm, current);
#define VSID_RANDOMIZER 42470972311 #define VSID_RANDOMIZER 42470972311UL
#define VSID_MASK 0xfffffffff #define VSID_MASK 0xfffffffffUL
/* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's /* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's
......
...@@ -12,18 +12,20 @@ ...@@ -12,18 +12,20 @@
#include <linux/config.h> #include <linux/config.h>
/* PAGE_SHIFT determines the page size */ #ifdef __ASSEMBLY__
#define PAGE_SHIFT 12 #define ASM_CONST(x) x
#ifndef __ASSEMBLY__
# define PAGE_SIZE (1UL << PAGE_SHIFT)
#else #else
# define PAGE_SIZE (1 << PAGE_SHIFT) #define ASM_CONST(x) x##UL
#endif #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_MASK (~(PAGE_SIZE-1))
#define PAGE_OFFSET_MASK (PAGE_SIZE-1) #define PAGE_OFFSET_MASK (PAGE_SIZE-1)
#define SID_SHIFT 28 #define SID_SHIFT 28
#define SID_MASK 0xfffffffff #define SID_MASK 0xfffffffffUL
#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK) #define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK)
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
...@@ -196,11 +198,11 @@ extern int page_is_ram(unsigned long physaddr); ...@@ -196,11 +198,11 @@ extern int page_is_ram(unsigned long physaddr);
/* KERNELBASE is defined for performance reasons. */ /* KERNELBASE is defined for performance reasons. */
/* When KERNELBASE moves, those macros may have */ /* When KERNELBASE moves, those macros may have */
/* to change! */ /* to change! */
#define PAGE_OFFSET 0xC000000000000000 #define PAGE_OFFSET ASM_CONST(0xC000000000000000)
#define KERNELBASE PAGE_OFFSET #define KERNELBASE PAGE_OFFSET
#define VMALLOCBASE 0xD000000000000000 #define VMALLOCBASE 0xD000000000000000UL
#define IOREGIONBASE 0xE000000000000000 #define IOREGIONBASE 0xE000000000000000UL
#define EEHREGIONBASE 0xA000000000000000 #define EEHREGIONBASE 0xA000000000000000UL
#define IO_REGION_ID (IOREGIONBASE>>REGION_SHIFT) #define IO_REGION_ID (IOREGIONBASE>>REGION_SHIFT)
#define EEH_REGION_ID (EEHREGIONBASE>>REGION_SHIFT) #define EEH_REGION_ID (EEHREGIONBASE>>REGION_SHIFT)
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
# define IDR_BITS 5 # define IDR_BITS 5
# define IDR_FULL 0xffffffff # define IDR_FULL 0xfffffffful
#elif BITS_PER_LONG == 64 #elif BITS_PER_LONG == 64
# define IDR_BITS 6 # define IDR_BITS 6
# define IDR_FULL 0xffffffffffffffff # define IDR_FULL 0xfffffffffffffffful
#else #else
# error "BITS_PER_LONG is not 32 or 64" # error "BITS_PER_LONG is not 32 or 64"
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment