Skip to content

Commit a6ce711

Browse files
mosaltertorvalds
authored andcommitted
um: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com> Acked-by: Richard Weinberger <richard@nod.at> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8b49233 commit a6ce711

1 file changed

Lines changed: 1 addition & 39 deletions

File tree

‎arch/um/include/asm/fixmap.h‎

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ enum fixed_addresses {
4343
extern void __set_fixmap (enum fixed_addresses idx,
4444
unsigned long phys, pgprot_t flags);
4545

46-
#define set_fixmap(idx, phys) \
47-
__set_fixmap(idx, phys, PAGE_KERNEL)
48-
/*
49-
* Some hardware wants to get fixmapped without caching.
50-
*/
51-
#define set_fixmap_nocache(idx, phys) \
52-
__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
5346
/*
5447
* used by vmalloc.c.
5548
*
@@ -62,37 +55,6 @@ extern void __set_fixmap (enum fixed_addresses idx,
6255
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
6356
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
6457

65-
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
66-
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
67-
68-
extern void __this_fixmap_does_not_exist(void);
69-
70-
/*
71-
* 'index to address' translation. If anyone tries to use the idx
72-
* directly without tranlation, we catch the bug with a NULL-deference
73-
* kernel oops. Illegal ranges of incoming indices are caught too.
74-
*/
75-
static inline unsigned long fix_to_virt(const unsigned int idx)
76-
{
77-
/*
78-
* this branch gets completely eliminated after inlining,
79-
* except when someone tries to use fixaddr indices in an
80-
* illegal way. (such as mixing up address types or using
81-
* out-of-range indices).
82-
*
83-
* If it doesn't get removed, the linker will complain
84-
* loudly with a reasonably clear error message..
85-
*/
86-
if (idx >= __end_of_fixed_addresses)
87-
__this_fixmap_does_not_exist();
88-
89-
return __fix_to_virt(idx);
90-
}
91-
92-
static inline unsigned long virt_to_fix(const unsigned long vaddr)
93-
{
94-
BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
95-
return __virt_to_fix(vaddr);
96-
}
58+
#include <asm-generic/fixmap.h>
9759

9860
#endif

0 commit comments

Comments
 (0)