diff options
author | Thierry Reding <treding@nvidia.com> | 2014-07-28 11:20:33 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-11-10 09:59:21 -0500 |
commit | 4707a341b4af57c72c1573a89d303559cf7bcf88 (patch) | |
tree | adf5f6360dafaf60e00995326b92cf1664828662 /arch/x86 | |
parent | dc01201476ec9d62e81c0ee181531bccd8b007ff (diff) |
/dev/mem: Use more consistent data types
The xlate_dev_{kmem,mem}_ptr() functions take either a physical address
or a kernel virtual address, so data types should be phys_addr_t and
void *. They both return a kernel virtual address which is only ever
used in calls to copy_{from,to}_user(), so make variables that store it
void * rather than char * for consistency.
Also only define a weak unxlate_dev_mem_ptr() function if architectures
haven't overridden them in the asm/io.h header file.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/io.h | 4 | ||||
-rw-r--r-- | arch/x86/mm/ioremap.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index b8237d8a1e0c..ae2b593e7c6e 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -310,8 +310,8 @@ BUILDIO(b, b, char) | |||
310 | BUILDIO(w, w, short) | 310 | BUILDIO(w, w, short) |
311 | BUILDIO(l, , int) | 311 | BUILDIO(l, , int) |
312 | 312 | ||
313 | extern void *xlate_dev_mem_ptr(unsigned long phys); | 313 | extern void *xlate_dev_mem_ptr(phys_addr_t phys); |
314 | extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr); | 314 | extern void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr); |
315 | 315 | ||
316 | extern int ioremap_change_attr(unsigned long vaddr, unsigned long size, | 316 | extern int ioremap_change_attr(unsigned long vaddr, unsigned long size, |
317 | unsigned long prot_val); | 317 | unsigned long prot_val); |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index af78e50ca6ce..b12f43c192cf 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -327,7 +327,7 @@ EXPORT_SYMBOL(iounmap); | |||
327 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 327 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
328 | * access | 328 | * access |
329 | */ | 329 | */ |
330 | void *xlate_dev_mem_ptr(unsigned long phys) | 330 | void *xlate_dev_mem_ptr(phys_addr_t phys) |
331 | { | 331 | { |
332 | void *addr; | 332 | void *addr; |
333 | unsigned long start = phys & PAGE_MASK; | 333 | unsigned long start = phys & PAGE_MASK; |
@@ -343,7 +343,7 @@ void *xlate_dev_mem_ptr(unsigned long phys) | |||
343 | return addr; | 343 | return addr; |
344 | } | 344 | } |
345 | 345 | ||
346 | void unxlate_dev_mem_ptr(unsigned long phys, void *addr) | 346 | void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) |
347 | { | 347 | { |
348 | if (page_is_ram(phys >> PAGE_SHIFT)) | 348 | if (page_is_ram(phys >> PAGE_SHIFT)) |
349 | return; | 349 | return; |