diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-03 18:54:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:39 -0400 |
commit | fd4fd5aac1282825195c6816ed40a2a6d42db5bf (patch) | |
tree | 5908cf4c88a7c9d69ea7bdc1c354d51b6ff47f86 /include/asm-frv | |
parent | 28ae55c98e4d16eac9a05a8a259d7763ef3aeb18 (diff) |
[PATCH] mm: consolidate get_order
Someone mentioned that almost all the architectures used basically the same
implementation of get_order. This patch consolidates them into
asm-generic/page.h and includes that in the appropriate places. The
exceptions are ia64 and ppc which have their own (presumably optimised)
versions.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-frv')
-rw-r--r-- | include/asm-frv/page.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index f7914f1782b0..4feba567e7fd 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h | |||
@@ -45,21 +45,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
45 | /* to align the pointer to the (next) page boundary */ | 45 | /* to align the pointer to the (next) page boundary */ |
46 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) | 46 | #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) |
47 | 47 | ||
48 | /* Pure 2^n version of get_order */ | ||
49 | static inline int get_order(unsigned long size) __attribute_const__; | ||
50 | static inline int get_order(unsigned long size) | ||
51 | { | ||
52 | int order; | ||
53 | |||
54 | size = (size - 1) >> (PAGE_SHIFT - 1); | ||
55 | order = -1; | ||
56 | do { | ||
57 | size >>= 1; | ||
58 | order++; | ||
59 | } while (size); | ||
60 | return order; | ||
61 | } | ||
62 | |||
63 | #define devmem_is_allowed(pfn) 1 | 48 | #define devmem_is_allowed(pfn) 1 |
64 | 49 | ||
65 | #define __pa(vaddr) virt_to_phys((void *) vaddr) | 50 | #define __pa(vaddr) virt_to_phys((void *) vaddr) |
@@ -102,4 +87,6 @@ extern unsigned long max_pfn; | |||
102 | #define WANT_PAGE_VIRTUAL 1 | 87 | #define WANT_PAGE_VIRTUAL 1 |
103 | #endif | 88 | #endif |
104 | 89 | ||
90 | #include <asm-generic/page.h> | ||
91 | |||
105 | #endif /* _ASM_PAGE_H */ | 92 | #endif /* _ASM_PAGE_H */ |