diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2008-02-04 10:48:05 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-02-04 10:48:05 -0500 |
| commit | 75ab43bfce51085ffd627c470f48ae49ba6e6da3 (patch) | |
| tree | f68ca5028631f6cb4fd37eb82366611238c2dec7 | |
| parent | e66aadbe6cb90813b3bbf07e3bc2a6aedcef7cd1 (diff) | |
x86: ioremap remove the range check of cpa
Now that cpa works on non-direct mappings as well, we can safely
remove the range check in ioremap_change_attr().
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | arch/x86/mm/ioremap.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 2c3fa7189503..4e21231a5ce2 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
| @@ -70,25 +70,12 @@ int page_is_ram(unsigned long pagenr) | |||
| 70 | * Fix up the linear direct mapping of the kernel to avoid cache attribute | 70 | * Fix up the linear direct mapping of the kernel to avoid cache attribute |
| 71 | * conflicts. | 71 | * conflicts. |
| 72 | */ | 72 | */ |
| 73 | static int ioremap_change_attr(unsigned long paddr, unsigned long size, | 73 | static int ioremap_change_attr(unsigned long vaddr, unsigned long size, |
| 74 | enum ioremap_mode mode) | 74 | enum ioremap_mode mode) |
| 75 | { | 75 | { |
| 76 | unsigned long vaddr = (unsigned long)__va(paddr); | ||
| 77 | unsigned long nrpages = size >> PAGE_SHIFT; | 76 | unsigned long nrpages = size >> PAGE_SHIFT; |
| 78 | unsigned int level; | ||
| 79 | int err; | 77 | int err; |
| 80 | 78 | ||
| 81 | /* No change for pages after the last mapping */ | ||
| 82 | if ((paddr + size - 1) >= (max_pfn_mapped << PAGE_SHIFT)) | ||
| 83 | return 0; | ||
| 84 | |||
| 85 | /* | ||
| 86 | * If there is no identity map for this address, | ||
| 87 | * change_page_attr_addr is unnecessary | ||
| 88 | */ | ||
| 89 | if (!lookup_address(vaddr, &level)) | ||
| 90 | return 0; | ||
| 91 | |||
| 92 | switch (mode) { | 79 | switch (mode) { |
| 93 | case IOR_MODE_UNCACHED: | 80 | case IOR_MODE_UNCACHED: |
| 94 | default: | 81 | default: |
| @@ -169,7 +156,7 @@ static void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, | |||
| 169 | return NULL; | 156 | return NULL; |
| 170 | } | 157 | } |
| 171 | 158 | ||
| 172 | if (ioremap_change_attr(phys_addr, size, mode) < 0) { | 159 | if (ioremap_change_attr(vaddr, size, mode) < 0) { |
| 173 | vunmap(area->addr); | 160 | vunmap(area->addr); |
| 174 | return NULL; | 161 | return NULL; |
| 175 | } | 162 | } |
