Skip to content

Commit

Permalink
x86: Fix the address space annotations of iomap_atomic_prot_pfn()
Browse files Browse the repository at this point in the history
This patch fixes the sparse warnings when the return pointer of
iomap_atomic_prot_pfn() is used as an argument of iowrite32()
and friends.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
LKML-Reference: <1283633804-11749-1-git-send-email-currojerez@riseup.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Francisco Jerez authored and Ingo Molnar committed Sep 5, 2010
1 parent b7d4608 commit cc1a8e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/iomap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>

void *
void __iomem *
iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);

void
iounmap_atomic(void *kvaddr, enum km_type type);
iounmap_atomic(void __iomem *kvaddr, enum km_type type);

int
iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/mm/iomap_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
/*
* Map 'pfn' using fixed map 'type' and protections 'prot'
*/
void *
void __iomem *
iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
{
/*
Expand All @@ -86,12 +86,12 @@ iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC))
prot = PAGE_KERNEL_UC_MINUS;

return kmap_atomic_prot_pfn(pfn, type, prot);
return (void __force __iomem *) kmap_atomic_prot_pfn(pfn, type, prot);
}
EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn);

void
iounmap_atomic(void *kvaddr, enum km_type type)
iounmap_atomic(void __iomem *kvaddr, enum km_type type)
{
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
Expand Down

0 comments on commit cc1a8e5

Please sign in to comment.