From 88cb773c5f8e45e48f3a89480610448974337cb0 Mon Sep 17 00:00:00 2001 From: Philippe De Muyter Date: Sun, 6 Dec 2009 20:28:41 +0100 Subject: m68k: Allow ioremapping top of memory The test in __ioremap to reject memory ranges crossing the 0 boundary rejects also memory ranges ending at the end of the memory. Fix that. Signed-off-by: Philippe De Muyter Signed-off-by: Geert Uytterhoeven --- arch/m68k/mm/kmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68k/mm/kmap.c') diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index df620ac2a296..cf93cdd515c5 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -116,7 +116,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla /* * Don't allow mappings that wrap.. */ - if (!size || size > physaddr + size) + if (!size || physaddr > (unsigned long)(-size)) return NULL; #ifdef CONFIG_AMIGA -- cgit v1.2.3 From f351d4bb3ce5a86f75cf297e38f87c4e437593d7 Mon Sep 17 00:00:00 2001 From: Philippe De Muyter Date: Thu, 22 Oct 2009 16:07:17 +0200 Subject: m68k{,nommu}/h8300: Remove obsolete comment about map_chunk Remove the comments referring to a function map_chunk that no longer exists. Signed-off-by: Philippe De Muyter Signed-off-by: Geert Uytterhoeven --- arch/h8300/mm/memory.c | 4 ++-- arch/m68k/mm/kmap.c | 3 +-- arch/m68knommu/mm/memory.c | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'arch/m68k/mm/kmap.c') diff --git a/arch/h8300/mm/memory.c b/arch/h8300/mm/memory.c index ccd6ade816dd..40d8aa811e4e 100644 --- a/arch/h8300/mm/memory.c +++ b/arch/h8300/mm/memory.c @@ -44,8 +44,8 @@ void cache_push_v (unsigned long vaddr, int len) { } -/* Map some physical address range into the kernel address space. The - * code is copied and adapted from map_chunk(). +/* + * Map some physical address range into the kernel address space. */ unsigned long kernel_map(unsigned long paddr, unsigned long size, diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index cf93cdd515c5..69345849454b 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -99,8 +99,7 @@ static inline void free_io_area(void *addr) #endif /* - * Map some physical address range into the kernel address space. The - * code is copied and adapted from map_chunk(). + * Map some physical address range into the kernel address space. */ /* Rewritten by Andreas Schwab to remove all races. */ diff --git a/arch/m68knommu/mm/memory.c b/arch/m68knommu/mm/memory.c index f93b88b51f9f..d5b9e1357808 100644 --- a/arch/m68knommu/mm/memory.c +++ b/arch/m68knommu/mm/memory.c @@ -24,7 +24,6 @@ /* * Map some physical address range into the kernel address space. - * The code is copied and adapted from map_chunk(). */ unsigned long kernel_map(unsigned long paddr, unsigned long size, -- cgit v1.2.3